public void checkKillBullet(EvilChopper c) { if (Position.X > c.Position.X + 600) { this.alive = false; } if (Position.X < c.Position.X - 600) { this.alive = false; } if(this.BoundingBox.Intersects(c.BoundingBox)){ this.alive=false; c.alive=false; } }
public void Veloc(EvilChopper chopper) { if (chopper.Position.X > Position.X) { Velocity.X += 0.1f; if (Velocity.X > 5) { Velocity.X = 5; } } if (chopper.Position.X <Position.X) { Velocity.X -= 0.1f; if (Velocity.X < -5) { Velocity.X = -5; } } if (chopper.Position.X == Position.X) { Velocity.X = 0; } if (chopper.Position.Y > Position.Y) { Velocity.Y += 0.1f; if (Velocity.Y > 5) { Velocity.Y = 5; } } if (chopper.Position.Y < Position.Y) { Velocity.Y -= 0.1f; if (Velocity.Y < -5) { Velocity.Y = -5; } } if (chopper.Position.Y == Position.Y) { Velocity.Y = 0; } }
public void Move(EvilChopper command) { prePosition = Position; Position.X += Velocity.X ; Position.Y += Velocity.Y; }