//Called whenever the player touches a coin public Boolean getCoin (FlxObject Coin, FlxObject Player) { Coin.kill (); score.text = "SCORE: " + (coins.CountDead () * 100); if (coins.CountLiving () == 0) { status.text = "Find the exit."; exit.Exists = true; } return true; }
//Called whenever the player touches the exit public Boolean win (FlxObject Exit, FlxObject Player) { status.text = "Yay, you won!"; score.text = "SCORE: 5000"; Player.kill (); return true; }
//This is an overlap callback function, triggered by the calls to FlxU.overlap(). protected bool overlapped(FlxObject object1,FlxObject object2) { if((object1 is EnemyBullet) || (object1 is Bullet)) object1.kill(); object2.hurt(1); return true; }