- Timestamp:
- 2012-07-06 11:46:27 (11 years ago)
- Location:
- 2012/27/LeeviK/PhysicsBall/PhysicsBall
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/27/LeeviK/PhysicsBall/PhysicsBall/PhysicsBall/PhysicsBall.cs
r3635 r3646 9 9 public class PhysicsBall : PhysicsGame 10 10 { 11 Image GAMEOVER = LoadImage("Game Over"); 12 PhysicsObject Tynnyri42; 13 PhysicsObject este12; 14 PhysicsObject este11; 15 PhysicsObject este10; 11 16 PhysicsObject Este5; 12 17 PhysicsObject Pelaaja4; … … 230 235 Add(este2); 231 236 este2.Image = BLOCK; 237 este2.Tag = "ESTE2"; 232 238 233 239 … … 251 257 MessageDisplay.Add("Kuolit!"); 252 258 } 253 259 else if (kohde.Tag.ToString() == "ESTE2") 260 { 261 Pelaaja1.X = -400; 262 Pelaaja1.Y = -100; 263 MessageDisplay.Add("Kuolit!"); 264 } 254 265 255 266 … … 302 313 Add(este5); 303 314 este5.X = -10; 304 este5.Y = 0;315 este5.Y = -30; 305 316 este5.Image = BLOCK; 306 317 este5.Tag = "ESTE5"; … … 317 328 este4.Tag = "ESTE4"; 318 329 este4.X = -30; 319 este4.Y = -2 50;330 este4.Y = -225; 320 331 este4.Image = BLOCK; 321 332 … … 329 340 330 341 AddCollisionHandler(Pelaaja3, KasittelePallonTormays4); 342 343 331 344 332 345 … … 369 382 Camera.Follow(Pelaaja4); 370 383 Camera.ZoomFactor = 2.0; 384 Pelaaja.KineticFriction = 0.8; 385 Pelaaja.Restitution = 0.2; 371 386 372 387 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, … … 396 411 AddCollisionHandler(Pelaaja4, KasittelePallonTormays5); 397 412 398 PhysicsObject Este5 = PhysicsObject.CreateStaticObject(20, 5 25);413 PhysicsObject Este5 = PhysicsObject.CreateStaticObject(20, 500 ); 399 414 Add(Este5); 400 415 Este5.X = -300; … … 403 418 Este5.Tag = "ESTE1"; 404 419 420 PhysicsObject este10 = PhysicsObject.CreateStaticObject(50, 525); 421 422 Add(este10); 423 este10.Tag = "ESTE10"; 424 este10.X = -100; 425 este10.Y = -0; 426 este10.Image = BLOCK; 427 428 PhysicsObject este11 = PhysicsObject.CreateStaticObject(50, 500); 429 Add(este11); 430 este11.Tag = "ESTE11"; 431 este11.X = 300; 432 este11.Y = -50; 433 este11.Image = BLOCK; 434 435 PhysicsObject este12 = PhysicsObject.CreateStaticObject(50, 525); 436 Add(este12); 437 este12.Tag = "ESTE12"; 438 este12.X = -200; 439 este12.Y = 150; 440 este12.Image = BLOCK; 441 442 PhysicsObject Tynnyri42 = PhysicsObject.CreateStaticObject(50, 50); 443 Add(Tynnyri42); 444 Tynnyri42.X = Level.Left; 445 Tynnyri42.Y = Level.Bottom; 446 Tynnyri42.Image = Barrel; 447 Tynnyri42.Tag = "TYNNYRI42"; 405 448 406 449 … … 419 462 MessageDisplay.Add("Kuolit!"); 420 463 464 } 465 else if (kohde.Tag.ToString() == "TYNNYRI42") 466 { 467 kohde.Destroy(); 468 ClearGameObjects(); 469 Camera.ZoomToLevel(); 470 Level.BackgroundColor = Color. Black; 471 Level.Background.Image = GAMEOVER; 421 472 } 422 473 -
2012/27/LeeviK/PhysicsBall/PhysicsBall/PhysicsBallContent/PhysicsBallContent.contentproj
r3581 r3646 142 142 </Compile> 143 143 </ItemGroup> 144 <ItemGroup> 145 <Compile Include="Game Over.png"> 146 <Name>Game Over</Name> 147 <Importer>TextureImporter</Importer> 148 <Processor>TextureProcessor</Processor> 149 </Compile> 150 </ItemGroup> 144 151 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 145 152 <!-- 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.