Changeset 1385 for 2010/30/alsiseoi/WorldOfBallcraft/Peli.cs
- Timestamp:
- 2010-07-28 14:56:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/alsiseoi/WorldOfBallcraft/Peli.cs
r1370 r1385 40 40 Level.BackgroundColor = new Color (62, 102, 55); 41 41 42 Player1 = LuoPelaaja(300, 200, 40, Color.Blue);42 Player1 = LuoPelaaja(300, 100, 40, Color.Blue); 43 43 44 Player2 = LuoPelaaja(300, 300, 40, Color.Red);44 Player2 = LuoPelaaja(300, 200, 40, Color.Red); 45 45 46 46 Camera.ZoomToLevel(); … … 48 48 49 49 VasenReuna = Level.CreateLeftBorder(); 50 VasenReuna.Restitution = 1.0;50 VasenReuna.Restitution = 0.0; 51 51 VasenReuna.IsVisible = true; 52 52 53 53 OikeaReuna = Level.CreateRightBorder(); 54 OikeaReuna.Restitution = 1.0;54 OikeaReuna.Restitution = 0.0; 55 55 OikeaReuna.IsVisible = true; 56 56 57 57 YlaReuna = Level.CreateTopBorder(); 58 YlaReuna.Restitution = 1.0;58 YlaReuna.Restitution = 0.0; 59 59 YlaReuna.IsVisible = true; 60 60 61 61 AlaReuna = Level.CreateBottomBorder(); 62 AlaReuna.Restitution = 1.0;62 AlaReuna.Restitution = 0.0; 63 63 AlaReuna.IsVisible = true; 64 64 65 PhysicsObject keppi = new PhysicsObject(20.0, 20.0); 66 keppi.Tag = "kepakko"; 67 Add(keppi); 65 PhysicsObject Vihollinen = new PhysicsObject(30.0, 20.0); 66 Vihollinen.Color = Color.GreenYellow; 67 Vihollinen.X = 100; 68 Vihollinen.Y = 150; 69 Vihollinen.Tag = "Osuma"; 70 Add(Vihollinen); 68 71 69 Brain aivot = new Brain(); 72 RandomMoverBrain satunnaisAivot = new RandomMoverBrain(); 73 Vihollinen.Brain = satunnaisAivot; 70 74 71 75 } … … 105 109 if (pelaaja == Player1) 106 110 { 107 if (kohde.Tag.ToString() == " kepakko")108 { 109 kohde.Color = Color.Blue;111 if (kohde.Tag.ToString() == "Osuma") 112 { 113 Player1.Destroy(); 110 114 } 111 115 } 112 116 117 if (pelaaja == Player2) 118 { 119 if (kohde.Tag.ToString() == "Osuma") 120 { 121 Player2.Destroy(); 122 } 123 } 113 124 } 125 114 126 } 115 127
Note: See TracChangeset
for help on using the changeset viewer.