public Biker(bool copy, String mask, Texture2D[] frames, abstractKeys keys, int engI, Engine eng, Texture2D FirstFrame, Vector2 position, Rectangle?sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, PhysicsManager pm, float jumpForce) : base(frames, keys, engI, eng, FirstFrame, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth, pm) { //this.fWheel = new Circle(); //this.bWheel = new Circle(); //this.coliisionPoints = new List<Circle>(); this.mask = mask; this.jumpForce = jumpForce; this.ID = engI; this.collideWithObstacle = false; this.touchesGround = collisionState.noCollision; //this.area = Tools.findArea(mask, new Point(2, 0)); this.start = new Vector2(this.Position.X, this.Position.Y); this.cam = new Camera(this, new Viewport(0, 0, Tools.W, Tools.H), Vector2.Zero, Global.zoom); ////setBikerMask(); fWheel = Global.fWheel; bWheel = Global.bWheel; area = Global.area; coliisionPoints = Global.cp; Game1.Event_Update += update; Background.Event_NextLevel += nxtLevel; }
void Awake() { inputState = GetComponent <inputState> (); walkBehavior = GetComponent <walk> (); animator = GetComponent <Animator> (); collisionState = GetComponent <collisionState> (); duckBehavior = GetComponent <duck> (); }
private void update() { this.touchesGround = pm.roadPlayerInteraction(this); if (collideWithObstacle == true) { this.dead = true; pm.bumped(this); collideWithObstacle = false; } this.switchingFrame(); }
protected virtual void Awake() { inputState = GetComponent <inputState> (); body2D = GetComponent <Rigidbody2D> (); collisionState = GetComponent <collisionState> (); }