void QuitGameMenuEntrySelected(object sender, PlayerIndexEvent e) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }
void PlayGameMenuEntrySelected(object sender, PlayerIndexEvent e) { LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen()); }
private void UpdateCollison() { Rectangle player; Rectangle enemyCruncherSpace; Rectangle enemySkullStoneSpace; Rectangle enemyFlyingBoneSpace; Rectangle projectile; player = new Rectangle((int)playerLocation.X, (int)playerLocation.Y, texture.Width / 3, texture.Height / 9); for (int x = 0; x < enemiesCrucher.Count; x++) { enemyCruncherSpace = new Rectangle((int)enemiesCrucher[x].Position.X, (int)enemiesCrucher[x].Position.Y, enemiesCrucher[x].Width, enemiesCrucher[x].Height); if (player.Intersects(enemyCruncherSpace)) { score += enemiesCrucher[x].Value; animatedSprite.Health -= enemiesCrucher[x].Damage; enemiesCrucher.RemoveAt(x); if (animatedSprite.Health == 0) { ScreenManager.AddScreen(new GameOverScreen(), ControllingPlayer); } } } for (int x = 0; x < enemiesFlyingBone.Count; x++) { enemyFlyingBoneSpace = new Rectangle((int)enemiesFlyingBone[x].Position.X, (int)enemiesFlyingBone[x].Position.Y, enemiesFlyingBone[x].Width, enemiesFlyingBone[x].Height); if (player.Intersects(enemyFlyingBoneSpace)) { score += enemiesFlyingBone[x].Value; animatedSprite.Health -= enemiesFlyingBone[x].Damage; enemiesFlyingBone.RemoveAt(x); if (animatedSprite.Health == 0) { ScreenManager.AddScreen(new GameOverScreen(), ControllingPlayer); } } } for (int x = 0; x < enemiesSkullStone.Count; x++) { enemySkullStoneSpace = new Rectangle((int)enemiesSkullStone[x].Position.X, (int)enemiesSkullStone[x].Position.Y, enemiesSkullStone[x].Width, enemiesSkullStone[x].Height); if (player.Intersects(enemySkullStoneSpace)) { score += enemiesSkullStone[x].Value; animatedSprite.Health -= enemiesSkullStone[x].Damage; enemiesSkullStone.RemoveAt(x); if (animatedSprite.Health == 0) { ScreenManager.AddScreen(new GameOverScreen(), ControllingPlayer); } } } for (int x = 0; x < projectiles.Count; x++) { projectile = new Rectangle((int)projectiles[x].Position.X, (int)projectiles[x].Position.Y, projectiles[x].Width, projectiles[x].Height); for (int y = 0; y < enemiesSkullStone.Count; y++) { enemySkullStoneSpace = new Rectangle((int)enemiesSkullStone[y].Position.X, (int)enemiesSkullStone[y].Position.Y, enemiesSkullStone[y].Width, enemiesSkullStone[y].Height); if (projectile.Intersects(enemySkullStoneSpace)) { score += enemiesSkullStone[y].Value; enemiesSkullStone.RemoveAt(y); projectiles.RemoveAt(x); if (score >= 7000) { LoadingScreen.Load(ScreenManager, true, ControllingPlayer, new GameplayLevel4Screen()); } } } for (int y = 0; y < enemiesCrucher.Count; y++) { enemyCruncherSpace = new Rectangle((int)enemiesCrucher[y].Position.X, (int)enemiesCrucher[y].Position.Y, enemiesCrucher[y].Width, enemiesCrucher[y].Height); if (projectile.Intersects(enemyCruncherSpace)) { score += enemiesCrucher[y].Value; enemiesCrucher.RemoveAt(y); projectiles.RemoveAt(x); if (score >= 7000) { LoadingScreen.Load(ScreenManager, true, ControllingPlayer, new GameplayLevel4Screen()); } } } for (int y = 0; y < enemiesFlyingBone.Count; y++) { enemyFlyingBoneSpace = new Rectangle((int)enemiesFlyingBone[y].Position.X, (int)enemiesFlyingBone[y].Position.Y, enemiesFlyingBone[y].Width, enemiesFlyingBone[y].Height); if (projectile.Intersects(enemyFlyingBoneSpace)) { score += enemiesFlyingBone[y].Value; enemiesFlyingBone.RemoveAt(y); projectiles.RemoveAt(x); if (score >= 7000) { LoadingScreen.Load(ScreenManager, true, ControllingPlayer, new GameplayLevel4Screen()); } } } } }