Sample code translated to OpenFL and Haxe from Chapter 11 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.
- Billiard1.hx — Demo
- Billiard2.hx — Demo
- Billiard3.hx — Demo
- Billiard4.hx — Demo
- MultiBilliard1.hx — Demo
- MultiBilliard2.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="Billiard1"/>
All except one of the samples are commented out:
<!-- <app main="Billiard2"/> -->
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=Billiard2