At this point in time, do not worry a great deal about the Mouse or Event features used in this example.
They will be discussed in detail a little later in the chapter.
import nme.Manager;
import nme.Surface;
import nme.Rect;
import nme.Point;
import nme.TTF;
class SimpleCollision
{
static var mainObject : SimpleCollision;
var running : Bool;
var click : Int;
var batR : Rect;
var bat : Point;
var bat2 : Point;
var batSrf : Surface;
var curTime : Float;
var prevTime : Float;
static function main()
{
mainObject = new SimpleCollision();
}
public function new()
{
prevTime = 0;
curTime = 0;
click = 0;
var mng = new Manager( 200, 200, ???Collision Test???, false, ???ico.gif??? );
batSrf = new Surface( ???bat.png??? );
batR = new Rect(24, 63, 65, 44);
bat = new Point( 0, 0 );
bat2 = new Point( 50, 50 );
batSrf.setKey( 255, 0, 255 );
var fps : Float;
running = true;
Chapter 19: Multimedia with Neko
545
while (running)
{
mng.events();
switch mng.getEventType()
{
case et_mousebutton:
if ( mng.
Pages:
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014