public CharacterSelection() { characterSelection = this; //menubuttons buttonList.Add("BTeam"); buttonList.Add("BrideRider"); buttonList.Add("FatMan"); buttonList.Add("Confirm"); buttonList.Add("Back"); }
public void Update(GameTime gameTime) { keyboard = Keyboard.GetState(); mouse = Mouse.GetState(); characterSelection = this; if (CheckKeyboard(Keys.D) || CheckKeyboard(Keys.Right)) { } if (CheckKeyboard(Keys.A) || CheckKeyboard(Keys.Left)) { } if (CheckKeyboard(Keys.W) || CheckKeyboard(Keys.Up)) { if (selected > 0) { selected--; } } if (CheckKeyboard(Keys.S) || CheckKeyboard(Keys.Down)) { if (selected < buttonList.Count - 1) { selected++; } } if (CheckKeyboard(Keys.Enter) || CheckKeyboard(Keys.Space)) { switch (selected) {//Gestern auf 1 2 3 geändert. keine ahunug was passiert case 0: currentSelectedCar = 2; Player.player.currentSelectedCar = 2; break; case 1: currentSelectedCar = 1; Player.player.currentSelectedCar = 1; break; case 2: currentSelectedCar = 3; Player.player.currentSelectedCar = 3; break; case 3: Game1.GameState = "Game"; Player.player.position.X = 4000; Player.player.position.Y = 2000; Player.player.score = 0; Player.player.enemiesKilled = 0; Player.player.shotsFired = 0; Game1.isPaused = false; Player.player.imageIndex = 0; break; case 4: Game1.GameState = "Menu"; break; } } prevKeyboard = keyboard; prevMouse = mouse; }