mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,67 @@
|
||||
package game.touchPool
|
||||
{
|
||||
public class TouchPoolGem
|
||||
{
|
||||
|
||||
private static const LIFETIME:int = 8;
|
||||
|
||||
public var _clone:Object;
|
||||
|
||||
public var _lifeTimer:Number;
|
||||
|
||||
public var _collected:Boolean;
|
||||
|
||||
private var _theGame:TouchPool;
|
||||
|
||||
public function TouchPoolGem(param1:TouchPool)
|
||||
{
|
||||
super();
|
||||
_theGame = param1;
|
||||
_clone = GETDEFINITIONBYNAME("tierneyPool_gem");
|
||||
}
|
||||
|
||||
public function reset() : void
|
||||
{
|
||||
_lifeTimer = 8;
|
||||
_collected = false;
|
||||
_clone.visible = true;
|
||||
}
|
||||
|
||||
public function heartbeat(param1:Number) : void
|
||||
{
|
||||
_lifeTimer -= param1;
|
||||
if(_lifeTimer < 3 && !_collected)
|
||||
{
|
||||
if(Math.floor(_lifeTimer * 10) % 2 == 0)
|
||||
{
|
||||
_clone.visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_clone.visible = true;
|
||||
}
|
||||
}
|
||||
if(_lifeTimer <= 0)
|
||||
{
|
||||
if(_clone.parent)
|
||||
{
|
||||
_clone.parent.removeChild(_clone);
|
||||
}
|
||||
}
|
||||
if(_clone.bounceSound)
|
||||
{
|
||||
_clone.bounceSound = false;
|
||||
_theGame._soundMan.playByName(_theGame["_soundNameGemCollision" + (Math.floor(Math.random() * 3) + 1)]);
|
||||
}
|
||||
}
|
||||
|
||||
public function collect() : void
|
||||
{
|
||||
_collected = true;
|
||||
_clone.collect();
|
||||
_clone.visible = true;
|
||||
_lifeTimer = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user