Changeset 4482
- Timestamp:
- 2013-07-05 12:27:37 (10 years ago)
- Location:
- 2013/27/ViljamiV
- Files:
-
- 11 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2013/27/ViljamiV/kill_everypody_GAME/kill_everypody_GAME/kill_everypody_GAME/kill_everypody_GAME.cs
r4438 r4482 30 30 31 31 SoundEffect laaserAani = LoadSoundEffect("maali"); 32 int nykyinenKentta = 1; 32 SoundEffect aseAani = LoadSoundEffect("laser"); 33 34 int nykyinenKentta = 4; 33 35 34 36 35 37 public override void Begin() 36 37 38 {38 { 39 SetWindowSize(1024, 768, false); 40 MediaPlayer.Play("perusmusa"); 39 41 AloitaKentta(nykyinenKentta); 40 42 } … … 59 61 60 62 Camera.Follow(pelaaja1); 61 Camera.ZoomFactor = 1. 2;63 Camera.ZoomFactor = 1.0; 62 64 Camera.StayInLevel = true; 63 65 … … 111 113 Add(ElamaPalkki); 112 114 } 115 113 116 void LuoKentta(string kentanNimi) 114 117 { 118 if (nykyinenKentta == 4) MediaPlayer.Play("dungeonboss"); 115 119 116 120 TileMap kentta = TileMap.FromLevelAsset(kentanNimi); … … 135 139 { 136 140 maaliAlue = paikka; 137 141 138 142 } 139 143 … … 147 151 DragonJonne.IgnoresGravity = true; 148 152 DragonJonne.Position = paikka; 153 DragonJonne.Mass = 50.0; 149 154 //vihu.Color = Color.Red; 150 155 DragonJonne.Image = DragonJonnenKuva; … … 162 167 Timer ajastin = new Timer(); 163 168 ajastin.Interval = 2.0; 164 ajastin.Timeout += delegate { DragonJonne.Hit(RandomGen.NextVector(200.0, 300.0)); }; 169 ajastin.Timeout += delegate 170 { 171 DragonJonne.Hit(RandomGen.NextVector(20000.0, 30000.0)); 172 173 }; 165 174 ajastin.Start(); 166 175 … … 186 195 void JonneVoittaa() 187 196 { 188 189 MessageDisplay.Add("JONNE WON!"); pelaaja1.Destroy(); 197 198 MessageDisplay.Add("JONNE WON!"); pelaaja1.Destroy(); 190 199 } 191 200 … … 267 276 //pelaaja1 on PlatformCharacter-tyyppinen 268 277 pelaaja1.Weapon = new AssaultRifle(30, 10); 278 pelaaja1.Weapon.AttackSound = null; 269 279 270 280 //Ammusten määrä aluksi: … … 317 327 void AloitaPeli() 318 328 { 329 nykyinenKentta--; 330 SeuraavaKentta(); 319 331 } 320 332 … … 324 336 { 325 337 Keyboard.Listen(Key.Space, ButtonState.Down, AmmuAseella, "Ammu", pelaaja1); 338 Keyboard.Listen(Key.Space, ButtonState.Pressed, delegate { if(voikoPelaajaAmpua) aseAani.Play(0.3, 0.0, 0.0); }, null); 339 Keyboard.Listen(Key.Space, ButtonState.Released, delegate { aseAani.Stop(); }, null); 326 340 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 327 341 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); … … 389 403 public DragonJonne(double leveys, double korkeus, int elamia) 390 404 : base(leveys, korkeus) 391 392 405 { 393 406 elamat = new DoubleMeter(elamia, 0, elamia); 394 407 elamat.LowerLimit += delegate { this.Destroy(); }; 395 408 } 396 409 397 410 398 411 -
2013/27/ViljamiV/kill_everypody_GAME/kill_everypody_GAME/kill_everypody_GAMEContent/kentta2.txt
r4438 r4482 15 15 ##### ######## ########### V # 16 16 ####### ############# # ## ###### ######################### # # 17 # V ##### 18 # ############### # V ### #19 ######### # * ############# ############ V# * V #17 # V ##### # # # 18 # ############### # # V # # 19 ######### # * ############# ############ # V #### * V # 20 20 # V ##### ### # ############ ## # # ########################################### 21 # ######### ####### ############# ## ##### # #22 ### ### # # ###### #### ######### *# #23 ##### # 21 # ######### ### ####### ############# # # # ##### # # 22 ### ### # # ###### # ######### *# # 23 ##### # # # ############# # 24 24 ####### # V # # V # V # V # ################# V # V # 25 ############################################################################################################ 25 ############################################################################################################ ## #################################################### # 26 26 # ### ############# ### 27 27 # ##### ############### ##### … … 29 29 # ############################################################################################################# ################### ########################################### 30 30 ### # ####################### # # # 31 ##### # ########################### N#32 ####### # V # V ############################### V # V # 31 ##### # ########################### # 32 ####### # V # V ############################### V # V # N # 33 33 ########################################################################################################################################################################################################################## 34 34 -
2013/27/ViljamiV/kill_everypody_GAME/kill_everypody_GAME/kill_everypody_GAMEContent/kill_everypody_GAMEContent.contentproj
r4438 r4482 142 142 </Compile> 143 143 </ItemGroup> 144 <ItemGroup> 145 <Compile Include="laser.wav"> 146 <Name>laser</Name> 147 <Importer>WavImporter</Importer> 148 <Processor>SoundEffectProcessor</Processor> 149 </Compile> 150 </ItemGroup> 151 <ItemGroup> 152 <Compile Include="TrollfaceHyppy.png"> 153 <Name>TrollfaceHyppy</Name> 154 <Importer>TextureImporter</Importer> 155 <Processor>TextureProcessor</Processor> 156 </Compile> 157 </ItemGroup> 158 <ItemGroup> 159 <Compile Include="TrollfaceTippuu.png"> 160 <Name>TrollfaceTippuu</Name> 161 <Importer>TextureImporter</Importer> 162 <Processor>TextureProcessor</Processor> 163 </Compile> 164 </ItemGroup> 165 <ItemGroup> 166 <Compile Include="perusmusa.mp3"> 167 <Name>perusmusa</Name> 168 <Importer>Mp3Importer</Importer> 169 <Processor>SongProcessor</Processor> 170 </Compile> 171 </ItemGroup> 172 <ItemGroup> 173 <Compile Include="dungeonboss.mp3"> 174 <Name>dungeonboss</Name> 175 <Importer>Mp3Importer</Importer> 176 <Processor>SongProcessor</Processor> 177 </Compile> 178 </ItemGroup> 144 179 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 145 180 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.