Changeset 4446
- Timestamp:
- 2013-07-04 15:34:20 (10 years ago)
- Location:
- 2013/27/TeemuM/Game/Game/Game
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/27/TeemuM/Game/Game/Game/Game.cs
r4444 r4446 29 29 menu.AddItemHandler(2, PerkMenu); 30 30 menu.AddItemHandler(3, Exit); 31 MediaPlayer.Play("MenuMusic");32 31 Add(menu); 33 32 … … 66 65 Score(int.Parse(commands[2])); 67 66 } 68 }69 else if (commands[0] == "tenthleveltaurenchieftain")70 {71 MediaPlayer.Play("SpesialEasterEgg");72 67 } 73 68 else if (commands[0] == "level") … … 142 137 else if (commands[0] == "die") 143 138 { 144 UI.GameOver(); 145 } 146 else if (commands[0] == "player") 147 { 148 if (commands[1] == "stop") 149 { 150 MediaPlayer.Stop(); 151 } 139 // UI.GameOver(); 152 140 } 153 141 else if (commands[0] == "exit") 154 142 { 155 143 Exit(); 144 } 145 else if (commands[0] == "maintenance") 146 { 147 int c = 0; 148 for (int i = 0; i < enemies.Count; i++) 149 { 150 if (enemies[i].IsDestroyed) 151 { 152 enemies.RemoveAt(i); 153 i--; 154 } 155 } 156 157 MessageDisplay.Add(c + " entities removed"); 156 158 } 157 159 else { MessageDisplay.Add("Unknow command!"); } … … 168 170 Keyboard.Listen(Key.Tab, ButtonState.Pressed, DeveloperCommand, null); 169 171 170 MediaPlayer.Stop(); 171 Timer mPlayer = new Timer(); 172 mPlayer.Interval = 3; 173 mPlayer.Timeout += BackgroundMusicPlayer; 174 mPlayer.Start(); 172 player = new Player(50, 50, 10, true); 173 Add(player); 174 Camera.Follow(player); 175 175 176 176 AddScoreMeter(); 177 178 Image background = LoadImage("Background");179 Level.Background.Image = background;180 181 player = new Player(50, 50, 10, true);182 Camera.Follow(player);183 Add(player);184 SpawnZombie();185 177 CreateLifeMeter(); 186 178 187 179 Timer t = new Timer(); 188 t.Interval = 1;180 t.Interval = 0.1; 189 181 t.Timeout += delegate() { SpawnZombie(); }; 190 182 t.Start(); 191 }192 193 private void BackgroundMusicPlayer()194 {195 if (!MediaPlayer.IsPlaying)196 MediaPlayer.Play("GameM" + RandomGen.NextInt(1, 5));197 183 } 198 184 -
2013/27/TeemuM/Game/Game/Game/Game.csproj
r4424 r4446 111 111 </ItemGroup> 112 112 <ItemGroup> 113 <Compile Include="AudioPlayer.cs" /> 113 114 <Compile Include="Enemies.cs" /> 114 115 <Compile Include="Ohjelma.cs" /> … … 116 117 <Compile Include="Player.cs" /> 117 118 <Compile Include="Properties\AssemblyInfo.cs" /> 118 <Compile Include="UI.cs" />119 119 </ItemGroup> 120 120 <ItemGroup> -
2013/27/TeemuM/Game/Game/Game/Player.cs
r4426 r4446 22 22 { 23 23 this.health = new IntMeter(health, 0, health); 24 this.health.LowerLimit += UI.GameOver; 24 this.health.LowerLimit += delegate 25 { 26 GameObject layer = new GameObject(Game.Screen.Width, Game.Screen.Height); 27 layer.Color = Color.Transparent; 28 layer.Position = this.Position; 29 Game.Add(layer, 1); 30 layer.FadeColorTo(Color.Lerp(Color.Transparent, Color.Black, 0.8), 1.0); 31 32 Label t = new Label("Game over"); 33 t.Position = this.Position; 34 Game.Add(t); 35 36 Timer.SingleShot(1, delegate { Game.IsPaused = true; }); 37 38 this.Destroy(); 39 }; 25 40 this.Tag = "player"; 26 41 this.Shape = Shape.Rectangle;
Note: See TracChangeset
for help on using the changeset viewer.