예제 #1
0
 public void moveTank(String direction)
 {
     if (tankState != TankState.Idle || tankState != TankState.Firing)
     {
         if (direction == "Left")
         {
             worldPosition.X -= 10;
             moveState = TankMovementState.MovingLeft;
         }
         else
         {
             worldPosition.X += 10;
             moveState = TankMovementState.MovingRight;
         }
     }
 }
예제 #2
0
        public override void Initialize()
        {
            textureName = "Tank";
            tankState = TankState.Idle;
            moveState = TankMovementState.Idle;
            score = 0;

            //Set-up Cannon
            shotAngle = 0;
            force = 50;
            contentManager = new ContentManager(Game.Services, "Content");
            cannonTexture = contentManager.Load<Texture2D>("Cannon");
            cannonLocation = new Vector2((worldPosition.X + 50), (worldPosition.Y + 10));

            base.Initialize();
        }