Prev | Current Page 1012 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Table 19 - 2 details these methods.
Part III: Extending the Possibilities
550
The following example is an update of the SimpleCollsion class, but with updates detailing animation,
timers, and events:
import nme.Manager;
import nme.Surface;
import nme.Sprite;
import nme.Rect;
import nme.Point;
import nme.Timer;
import nme.TTF;
class Collision
{
static var mainObject : Collision;
var running : Bool;
var bat : Sprite;
var bat2 : Sprite;
var keys : Array < Bool > ;
var curTime : Float;
var prevTime : Float;
static function main()
Table 19-2
Method Description
GetEventType Pops an event off of the event stack and returns an EventType enumerator
depicting the type of the event. Once popped, you can then query the even
further using one of the methods below.
LastKey Returns the ASCII key code of the last pressed key. You can use the haXe
String class method fromCharCode to convert the value back into a
recognizable character.
MouseButton Returns the last clicked mouse button, where 1 is the left button, 2 is the
right button, and 3 is the middle button.


Pages:
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024