Sample code translated to OpenFL and Haxe from Chapter 6 of Foundation ActionScript 3.0 Animation: Making Things Move by Keith Peters (Apress, 2007).
Ported and shared with permission. Thank you, Keith.
Several samples from this chapter are available in the src directory.
- Bouncing1.hx — Demo
- Bouncing2.hx — Demo
- Fountain.hx — Demo
- Friction1.hx — Demo
- Friction2.hx — Demo
- Removal.hx — Demo
- ShipSim2.hx — Demo
- ShipSimFriction.hx — Demo
This directory contains an OpenFL project. The project.xml file specifies the project's configuration options, and the Haxe source code appears in the src directory.
To run this project, open a terminal in this directory, and run the following command:
openfl test html5
The project.xml file contains a line for each sample, like this:
<app main="Bouncing1"/>
All except one of the samples are commented out:
<!-- <app main="Fountain"/> -->
To switch between samples, comment out the currently selected sample, and uncomment a different sample. Then, run openfl test html5
again.
Alternatively, you can switch between samples without modifying project.xml by specifying the --app-main
command line option with the sample name.
openfl test html5 --app-main=Fountain