- Timestamp:
- 2010-07-09 12:50:24 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/viaawipi/samsh cubes/Peli.cs
r1215 r1224 6 6 7 7 8 /// <summary> 9 /// tehnyt ville piesala 10 /// </summary> 8 11 class Tasohyppely : PhysicsGame 9 { 12 { // 10 13 const int rulev = 50; 11 14 const int rukor = 50; … … 28 31 { 29 32 30 31 isku1 = new IntMeter(0);32 isku2 = new IntMeter(0);33 34 33 // Zoomataan lähemmäksi 35 34 … … 52 51 // Asetetaan painovoima 53 52 Gravity = new Vector(0, -1000); 53 54 LuoLas1(); 55 LuoLas2(); 54 56 55 57 luoKentta(); … … 76 78 Level.Background.CreateGradient(Color.White, Color.SkyBlue); 77 79 Level.Background.Image = LoadImage("aa"); 80 78 81 79 82 … … 90 93 PhysicsObject Luotaso() 91 94 { 92 PhysicsObject taso = PhysicsObject.CreateStaticObject(50.0, 50.0 );95 PhysicsObject taso = PhysicsObject.CreateStaticObject(50.0, 50.0,Shapes.Rectangle,CollisionShapeQuality.Best); 93 96 taso.Image = LoadImage("seina"); 94 97 return taso; … … 102 105 pelaaja1.X = 100; 103 106 pelaaja1.Y = 120; 107 pelaaja1.CanRotate = true; 104 108 105 109 pelaaja2 = new PlatformCharacter(40, 40); … … 108 112 pelaaja2.X = -100; 109 113 pelaaja2.Y = 120; 114 pelaaja2.CanRotate = true; 115 110 116 111 117 AddCollisionHandler(pelaaja1, kasitteletormays); … … 172 178 if (aba.Magnitude<75) 173 179 { 174 isku1.Value +=RandomGen.NextInt( 1,10);180 isku1.Value +=RandomGen.NextInt(5,10); 175 181 pelaaja2.Hit(new Vector(aba.X * isku1, aba.Y * isku1)); 176 182 PlaySound("plzbmfire"); … … 184 190 if (aba.Magnitude < 75) 185 191 { 186 isku2.Value += RandomGen.NextInt( 1, 10);192 isku2.Value += RandomGen.NextInt(5, 10); 187 193 pelaaja1.Hit(new Vector(aba.X * isku2, aba.Y * isku2)); 188 194 PlaySound("icebfire"); … … 196 202 197 203 198 Grenade kranaatti = new Grenade(RandomGen.NextDouble(0.5, 4));204 Grenade kranaatti = new Grenade(RandomGen.NextDouble(0.5,10)); 199 205 kranaatti.X = RandomGen.NextDouble(Level.Left, Level.Right); 200 206 kranaatti.Y = Level.Top - 10; … … 203 209 kranaatti.ExplosionRadius = 50; 204 210 kranaatti.ExplosionSpeed = 100; 211 kranaatti.Image = LoadImage("norsu"); 205 212 206 213 Add(kranaatti); … … 212 219 } 213 220 221 void LuoLas2() 222 { 223 isku1 = new IntMeter(0); 224 225 Label pisteNaytto = new Label(); 226 pisteNaytto.X = Screen.Left + 100; 227 pisteNaytto.Y = Screen.Top - 100; 228 pisteNaytto.TextColor = Color.Cyan; 229 230 pisteNaytto .BindTo(isku1); 231 Add(pisteNaytto); 232 } 233 void LuoLas1() 234 { 235 isku2 = new IntMeter(0); 236 237 Label pisteNaytto = new Label(); 238 pisteNaytto.X = Screen.Right - 100; 239 pisteNaytto.Y = Screen.Top - 100; 240 pisteNaytto.TextColor = Color.Red; 241 242 pisteNaytto.BindTo(isku2); 243 Add(pisteNaytto); 244 } 245 214 246 215 247
Note: See TracChangeset
for help on using the changeset viewer.