- Timestamp:
- 2016-04-16 15:00:39 (7 years ago)
- Location:
- 2015/koodauskerho/OttoR
- Files:
-
- 8 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/BattleArena.cs
r7137 r7153 18 18 int vahinko = 0; 19 19 20 DoubleMeter elamaLaskuri; 21 20 22 Image ShadowKuva = LoadImage("monsters/shadow"); 21 23 Image DirtKuva = LoadImage("blocks/dirt"); 22 24 Image TaintedGrassKuva = LoadImage("blocks/taintedgrass"); 23 25 Image BassoKuva = LoadImage("blocks/Basso"); 26 Image FreakKuva = LoadImage("blocks/Freak"); 24 27 Image pelaajanKuva = LoadImage("characters/bad/paha"); 25 28 Image pelaajanAseenKuva = LoadImage("characters/normi/rifle"); … … 64 67 SmoothTextures = false; 65 68 } 66 69 70 67 71 void LuoAlkuvalikko() 68 72 { … … 136 140 kentta.SetTileMethod('N', LisaaPelaaja); 137 141 kentta.SetTileMethod('F', LisaaFireFlower); 142 kentta.SetTileMethod('f', LisaaFreak); 138 143 kentta.SetTileMethod('G', LisaaGrass); 139 144 kentta.SetTileMethod('B', LisaaboomBox); 140 kentta.SetTileMethod('X', LisaaBasso); 145 kentta.SetTileMethod('X', LisaaBasso); 141 146 kentta.SetTileMethod('T', LisaaTaintedGrass); 142 147 kentta.SetTileMethod('S', LisaaShadow); … … 148 153 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 149 154 155 Timer ajastin = new Timer(); 156 ajastin.Interval = 1.5; 157 //ajastin.Timeout += UusiaShadoweja; 158 ajastin.Start(); 159 160 150 161 LisaaNappaimet(); 162 LuoElamaLaskuri(); 151 163 152 164 Camera.Follow(pelaaja1); … … 217 229 Add(boomBox); 218 230 } 231 void LisaaFreak(Vector paikka, double leveys, double korkeus) 232 { 233 PhysicsObject Freak = PhysicsObject.CreateStaticObject(leveys, korkeus); 234 Freak.IgnoresCollisionResponse = true; 235 Freak.Position = paikka; 236 Freak.Image = FreakKuva; 237 Freak.Tag = "Freak"; 238 Add(Freak); 239 } 219 240 void LisaaBasso(Vector paikka, double leveys, double korkeus) 220 241 { … … 226 247 Add(Basso); 227 248 } 249 250 228 251 void LisaaShadow(Vector paikka, double leveys, double korkeus) 229 252 { … … 232 255 Shadow.Position = paikka; 233 256 Shadow.Mass = 3.5; 234 Shadow.Tag = " monster";257 Shadow.Tag = "Shadow"; 235 258 Shadow.CanMoveOnAir = true; 236 259 237 260 PlatformWandererBrain tasoAivot = new PlatformWandererBrain(); 238 261 tasoAivot.Speed = 150; … … 244 267 Shadow.Brain = tasoAivot; 245 268 Add(Shadow); 269 270 271 272 273 } 274 void UusiaShadoveja() 275 { 246 276 247 277 } … … 271 301 272 302 pelaaja1.Image = pelaajanKuva; 273 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 274 AddCollisionHandler(pelaaja1, "boomBox", TormaaBoxiin); 275 AddCollisionHandler(pelaaja1, "Basso", TormaaBassoon); 303 304 276 305 switch (pelaaja1hahmo) 277 306 { … … 352 381 353 382 Add(pelaaja1, 1); 354 } 383 384 AddCollisionHandler(pelaaja1, "tahti", TormaaTahteen); 385 AddCollisionHandler(pelaaja1, "boomBox", TormaaBoxiin); 386 AddCollisionHandler(pelaaja1, "Basso", TormaaBassoon); 387 AddCollisionHandler(pelaaja1, "Freak", TormaaFreakiin); 388 AddCollisionHandler(pelaaja1, "Shadow", TormaaShadowiin); 389 } 390 391 void LuoElamaLaskuri() 392 { 393 elamaLaskuri = new DoubleMeter(100); 394 elamaLaskuri.MaxValue = 100; 395 elamaLaskuri.LowerLimit += ElamaLoppui; 396 397 ProgressBar elamaPalkki = new ProgressBar(150, 20); 398 elamaPalkki.X = Screen.Left + 550; 399 elamaPalkki.Y = Screen.Top - 20; 400 elamaPalkki.BindTo(elamaLaskuri); 401 Add(elamaPalkki); 402 403 //Taustaväri: 404 elamaPalkki.Color = Color.Transparent; 405 406 //Palkin väri: 407 elamaPalkki.BarColor = Color.Red; 408 409 //Reunan väri: 410 elamaPalkki.BorderColor = Color.Black; 411 } 412 void ElamaLoppui() 413 { 414 MessageDisplay.Add("RIP"); 415 pelaaja1.Destroy(); 416 } 417 355 418 void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 356 419 { … … 413 476 { 414 477 MediaPlayer.Stop(); 415 MessageDisplay.Add("Lets dance, shall we?"); 416 MediaPlayer.Play("music/taustamusiikki"); 417 478 MessageDisplay.Add("Gentlemen"); 479 MediaPlayer.Play("music/taustamusiikki"); 418 480 } 419 481 void TormaaBoxiin(PhysicsObject hahmo, PhysicsObject boomBox) 420 482 { 421 // 422 MessageDisplay.Add(" Lets go");483 //MediaPlayer.Stop(); 484 MessageDisplay.Add("A Happy day"); 423 485 MediaPlayer.Play("music/boombox"); 424 425 } 486 } 487 426 488 void TormaaBassoon(PhysicsObject hahmo, PhysicsObject Basso) 427 489 { 428 490 //MediaPlayer.Stop(); 429 MessageDisplay.Add(" Drop the beat");491 MessageDisplay.Add("Warrior of the night"); 430 492 MediaPlayer.Play("music/warrior"); 431 493 432 494 } 495 void TormaaFreakiin(PhysicsObject hahmo, PhysicsObject Freak) 496 { 497 //MediaPlayer.Stop(); 498 MessageDisplay.Add("Freak It"); 499 MediaPlayer.Play("music/freak it"); 500 501 } 502 503 void TormaaShadowiin(PhysicsObject hahmo, PhysicsObject Shadow) 504 { 505 elamaLaskuri.Value -= 15; 506 } 507 433 508 } -
2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/BattleArena.csproj.Debug.cachefile
r7137 r7153 33 33 Content\monsters\shadow.xnb 34 34 Content\blocks\fuel1.xnb 35 Content\blocks\Freak.xnb 36 Content\music\freak it.xnb 35 37 Content\music\taustamusiikki.wma 36 38 Content\music\boombox.wma 37 39 Content\music\warrior.wma 40 Content\music\freak it.wma -
2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/obj/x86/Debug/BattleArena.csproj.FileListAbsolute.txt
r7137 r7153 44 44 C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\monsters\shadow.xnb 45 45 C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\fuel1.xnb 46 C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\Freak.xnb 47 C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\music\freak it.xnb 48 C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\music\freak it.wma -
2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml
r7137 r7153 36 36 <Options>None</Options> 37 37 <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\kentta1.xnb</Output> 38 <Time>2016-0 3-12T14:49:11.4138492+02:00</Time>38 <Time>2016-04-16T12:51:33.1175299+03:00</Time> 39 39 </Item> 40 40 <Item> … … 225 225 <Options>None</Options> 226 226 <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\boomBox.xnb</Output> 227 <Time>2016-0 3-12T11:01:52.6303357+02:00</Time>227 <Time>2016-04-16T10:09:35.3138553+03:00</Time> 228 228 </Item> 229 229 <Item> … … 254 254 <Options>None</Options> 255 255 <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\Basso.xnb</Output> 256 <Time>2016-0 3-12T11:19:21.5540481+02:00</Time>256 <Time>2016-04-16T10:02:41.8536553+03:00</Time> 257 257 </Item> 258 258 <Item> … … 310 310 <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\fuel1.xnb</Output> 311 311 <Time>2016-03-12T14:18:55.0378245+02:00</Time> 312 </Item> 313 <Item> 314 <Source>blocks\Freak.png</Source> 315 <Name>blocks\Freak</Name> 316 <Importer>TextureImporter</Importer> 317 <Processor>TextureProcessor</Processor> 318 <Options>None</Options> 319 <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\blocks\Freak.xnb</Output> 320 <Time>2016-04-16T10:10:08.4828553+03:00</Time> 321 </Item> 322 <Item> 323 <Source>music\freak it.mp3</Source> 324 <Name>music\freak it</Name> 325 <Importer>Mp3Importer</Importer> 326 <Processor>SongProcessor</Processor> 327 <Options>None</Options> 328 <Output>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\music\freak it.xnb</Output> 329 <Extra>C:\MyTemp\OttoR\BattleArena\BattleArena\BattleArena\bin\x86\Debug\Content\music\freak it.wma</Extra> 330 <Time>2016-04-16T10:11:38.5558553+03:00</Time> 312 331 </Item> 313 332 <BuildSuccessful>true</BuildSuccessful> -
2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArena/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt
r7137 r7153 36 36 Content\monsters\shadow.xnb 37 37 Content\blocks\fuel1.xnb 38 Content\blocks\Freak.xnb 39 Content\music\freak it.xnb 40 Content\music\freak it.wma -
2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArenaContent/BattleArenaContent.contentproj
r7137 r7153 279 279 </Compile> 280 280 </ItemGroup> 281 <ItemGroup> 282 <Compile Include="blocks\Freak.png"> 283 <Name>Freak</Name> 284 <Importer>TextureImporter</Importer> 285 <Processor>TextureProcessor</Processor> 286 </Compile> 287 </ItemGroup> 288 <ItemGroup> 289 <Compile Include="music\freak it.mp3"> 290 <Name>freak it</Name> 291 <Importer>Mp3Importer</Importer> 292 <Processor>SongProcessor</Processor> 293 </Compile> 294 </ItemGroup> 281 295 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 282 296 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2015/koodauskerho/OttoR/BattleArena/BattleArena/BattleArenaContent/kentta1.txt
r7137 r7153 1 2 3 4 C 5 ## ## #### 6 7 # C C C8 # ## ## ## *9 # ####10 # F X11 # ## ## ## ## #12 # ### #13 # B S d S14 # ## ## ## ## ### S d TTTTTTTTTTTTTTTTTTTTTT d S d15 # #TTTTTTTTDDDDDDDDDDDDDDDDDDDDDDTTTTTTTTTTTTTTT d d S16 # B N #TTTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTTTTTTTTTTTT17 GGGGGGGGGGGGGGGGGGGGGGGGGG TTTTTTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD1 # 2 # 3 # 4 # S S S 5 # ## ## #### s s 6 #* 7 ##### S S S 8 # ## ## ## S 9 #X #### 10 ### 11 # ####### S 12 #B ## ### 13 ## # ### S d S S S 14 # ##### ## ####### # S d TTTTTTTTTTTTTTTTTTTTTT d S d 15 #f ## TTTTTTTTDDDDDDDDDDDDDDDDDDDDDDTTTTTTTTTTTTTTT d d S 16 ## # N ### S TTTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDTTTTTTTTTTTT 17 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGTTTTTTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
Note: See TracChangeset
for help on using the changeset viewer.