Game Development Reference
In-Depth Information
package example {
import com.flashgamebook.engines.platformer.sprites.
IPlayer;
import flash.display.Sprite;
import flash.geom.Vector3D;
public class Player extends Sprite implements IPlayer {
private var _netForce:Vector3D = new Vector3D();
private var _tempX:Number = 0;
private var _tempY:Number = 0;
public function get netForce():Vector3D {
return _netForce;
}
public function set netForce(value:Vector3D):void {
_netForce = value;
}
public function get isJumping():Boolean {
if (_netForce.y < 0) return true;
return false;
}
public function set isJumping(value:Boolean):void {
}
public function get isFalling():Boolean {
if (_netForce.y > 0) return true;
return false;
}
public function set isFalling(value:Boolean):void {
}
public function get tempX():Number {
return _tempX;
}
public function set tempX(value:Number):void {
_tempX = value;
}
public function get tempY():Number {
return _tempY;
Search Nedrilad ::




Custom Search