Changeset 680
- Timestamp:
- 2010-06-10 14:43:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/lasakauh/Testi/Peli.cs
r674 r680 16 16 PlatformCharacter p1; 17 17 PlatformCharacter p2; 18 //int hp1 = 100; 19 //int hp2 = 100; 18 19 int hp1 = 102; 20 int hp2 = 102; 20 21 21 22 … … 30 31 luoKentta(); 31 32 lisaaNappaimet(); 32 33 34 } 35 33 voitto(p1, p2); 34 voitto(p2, p1); 35 36 37 38 } 39 40 void voitto(PlatformCharacter hahmo, PlatformCharacter voittaja) 41 { 42 if (hahmo.IsDestroyed()) 43 { 44 MessageDisplay.Add(voittaja+" voitti pelin"); 45 } 46 47 } 36 48 void luoKentta() 37 49 { … … 86 98 p1 = new PlatformCharacter(10, 20); 87 99 p1.Mass = 6.0; 88 //Animation("p1_ani",65,false);89 100 p1.Image = LoadImage("ninja"); 90 //p1.Animation = LoadImage("p1_ani");91 101 p1.X = -140; 92 102 p1.Y = Level.Bottom + 100; 93 103 Add(p1); 94 95 104 if (hp1 < 0) { 105 p1.Destroy(); 106 MessageDisplay.Add("Pelaaja 2 voitti"); 107 }; 108 96 109 } 97 110 … … 104 117 p2.Y = Level.Bottom + 100; 105 118 Add(p2); 119 if (hp2 < 0) { 120 p2.Destroy(); 121 }; 106 122 107 123 } … … 175 191 void hpp1(double x, double hp1) 176 192 { 177 for (int i = 1; i < 102; i++)193 for (int i = 1; i < hp1; i++) 178 194 { 179 195 PhysicsObject hpp1 = PhysicsObject.CreateStaticObject(1, 8.5); … … 187 203 void hpp2(double x, double hp2) 188 204 { 189 for (int i = 1; i < 102; i++)205 for (int i = 1; i < hp2; i++) 190 206 { 191 207 PhysicsObject hpp2 = PhysicsObject.CreateStaticObject(1, 8.5); … … 204 220 p1.Animation.Start(); 205 221 p1.Animation.FPS = 20; 222 hp2 = hp2-10; 206 223 207 224 } … … 213 230 p2.Animation.Start(); 214 231 p2.Animation.FPS = 20; 232 hp1 = hp1 - 10; 215 233 } 216 234
Note: See TracChangeset
for help on using the changeset viewer.