mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 17:37:50 -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
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,31 @@
|
||||
package game.pVP_Marbles
|
||||
{
|
||||
import Box2D.Collision.Shapes.b2Shape;
|
||||
import Box2D.Common.Math.b2Vec2;
|
||||
import Box2D.Dynamics.Contacts.b2ContactResult;
|
||||
import Box2D.Dynamics.b2ContactListener;
|
||||
|
||||
public class PVP_Marbles_ContactListener extends b2ContactListener
|
||||
{
|
||||
|
||||
public var contactStack:Array = [];
|
||||
|
||||
public function PVP_Marbles_ContactListener()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function Result(param1:b2ContactResult) : void
|
||||
{
|
||||
var _loc2_:b2Shape = param1.shape1;
|
||||
var _loc3_:b2Shape = param1.shape2;
|
||||
var _loc4_:Number = param1.normalImpulse;
|
||||
var _loc5_:b2Vec2 = param1.position;
|
||||
if(_loc4_ > 1)
|
||||
{
|
||||
contactStack.push(new PVP_Marbles_CustomContactPoint(_loc2_,_loc3_,_loc4_,_loc5_));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package game.pVP_Marbles
|
||||
{
|
||||
import Box2D.Collision.Shapes.b2Shape;
|
||||
import Box2D.Common.Math.b2Vec2;
|
||||
|
||||
public class PVP_Marbles_CustomContactPoint
|
||||
{
|
||||
|
||||
public var shape1:b2Shape;
|
||||
|
||||
public var shape2:b2Shape;
|
||||
|
||||
public var separation:Number;
|
||||
|
||||
public var position:b2Vec2;
|
||||
|
||||
public var velocity:b2Vec2;
|
||||
|
||||
public var normal:b2Vec2;
|
||||
|
||||
public var force:Number;
|
||||
|
||||
public var normalImpulse:Number;
|
||||
|
||||
public var tangentImpulse:Number;
|
||||
|
||||
public function PVP_Marbles_CustomContactPoint(param1:b2Shape, param2:b2Shape, param3:Number, param4:b2Vec2)
|
||||
{
|
||||
super();
|
||||
shape1 = param1;
|
||||
shape2 = param2;
|
||||
normalImpulse = param3;
|
||||
position = param4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package game.pVP_Marbles
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
|
||||
public class PVP_Marbles_Marble extends MovieClip
|
||||
{
|
||||
|
||||
private static const FADE_RATE:Number = 0.1;
|
||||
|
||||
public var _fadeIn:Boolean;
|
||||
|
||||
public var _fadedOut:Function;
|
||||
|
||||
public var _fadedIn:Function;
|
||||
|
||||
public var _delayTime:Number;
|
||||
|
||||
public function PVP_Marbles_Marble()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function fade(param1:Function) : void
|
||||
{
|
||||
alpha -= 0.1;
|
||||
_fadeIn = false;
|
||||
_fadedOut = param1;
|
||||
addEventListener("enterFrame",heartbeat);
|
||||
}
|
||||
|
||||
public function heartbeat(param1:Event) : void
|
||||
{
|
||||
if(_fadeIn)
|
||||
{
|
||||
alpha += 0.1;
|
||||
if(alpha >= 1)
|
||||
{
|
||||
alpha = 1;
|
||||
removeEventListener("enterFrame",heartbeat);
|
||||
if(_fadedIn != null)
|
||||
{
|
||||
_fadedIn(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(_delayTime > 0)
|
||||
{
|
||||
_delayTime -= 0.04;
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha -= 0.1;
|
||||
if(alpha <= 0)
|
||||
{
|
||||
alpha = 0;
|
||||
_fadedOut(this);
|
||||
_fadeIn = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user