/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } }
public override void Update(Game1 game) { spritePosition.X += spriteSpeed; if (spritePosition.X > Game1.SCREEN_WIDTH + 200) { active = false; } base.Update(game); }
public override void Update(Game1 game) { if (!Die) { spritePosition.Y -= spriteSpeed; if (spritePosition.Y < (0 - spriteTexture.Height)) { spritePosition.Y = Game1.SCREEN_HEIGHT; } } base.Update(game); }
public new virtual void Update(Game1 game) { if (Die) { if (alphaLevel <= 0.0f) { active = false; game.Score += ScoreValue; } alphaLevel -= .05f; } base.Update(game); }
public void Update(GamePadState currentGamePadState, GamePadState previousGamePadState, KeyboardState currentKeyboardState, KeyboardState previousKeyboardState, Game1 game) { float stickY = currentGamePadState.ThumbSticks.Left.Y; spritePosition.Y -= stickY * spriteSpeed; if(currentKeyboardState.IsKeyDown(Keys.W)) { spritePosition.Y -= spriteSpeed; } if (currentKeyboardState.IsKeyDown(Keys.S)) { spritePosition.Y += spriteSpeed; } if (spritePosition.Y <= 0) { spritePosition.Y = 0; } else if (spritePosition.Y >= Game1.SCREEN_HEIGHT - spriteTexture.Height) { spritePosition.Y = Game1.SCREEN_HEIGHT - spriteTexture.Height; } if (currentGamePadState.IsButtonDown(Buttons.A) && previousGamePadState.IsButtonUp(Buttons.A)) { if (Ammo > 0) { arrows.Add(new Missile(arrowTexture, new Vector2(this.spritePosition.X, this.spritePosition.Y + 13), 8.0f)); Ammo--; } } List<Missile> newArrowList = new List<Missile>(); foreach(Missile arrow in arrows) { arrow.Update(game); if (arrow.getActive()) { newArrowList.Add(arrow); } } arrows = newArrowList; }
public override void Update(Game1 game) { base.Update(game); }
public virtual void Update(Game1 game) { }