Changeset 925 for 2010/24/tekrjant/Laskuvarjo/Peli.cs
- Timestamp:
- 2010-06-16 18:54:31 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/24/tekrjant/Laskuvarjo/Peli.cs
r924 r925 17 17 PlatformCharacter pelaaja; 18 18 GameObject laskuvarjo; 19 19 20 double keinumisSuunta = 1.0; 21 bool hengissa = true; 20 22 21 23 protected override void Begin() … … 98 100 void PelaajaOsuu(PhysicsObject pelaaja, PhysicsObject toinen) 99 101 { 100 if (toinen == maasto) 101 { 102 SuljeLaskuvarjo(); 103 104 MessageDisplay.Add("nopeus: " + pelaaja.Velocity.Y); 105 106 if (Math.Abs(pelaaja.Velocity.Y) > 200) 102 SuljeLaskuvarjo(); 103 104 MessageDisplay.Add("nopeus: " + pelaaja.Velocity.Y); 105 106 if (Math.Abs(pelaaja.Velocity.Y) > 200) 107 { 108 // auts... 109 if (Gore) 107 110 { 108 // auts... 109 if (Gore) 111 for (int i = 0; i < 100; i++) 110 112 { 111 for (int i = 0; i < 100; i++) 112 { 113 PhysicsObject jama = new PhysicsObject(RandomGen.NextInt(1, 5), RandomGen.NextInt(1, 5)); 114 jama.X = pelaaja.X; 115 jama.Y = pelaaja.Y; 116 Vector maiskeenlento = Vector.FromLengthAndAngle(RandomGen.NextDouble(0, 1000), RandomGen.NextAngle()); 117 jama.KineticFriction = 0.5; 118 jama.LinearDamping = 0.99; 119 jama.Color = RandomGen.NextColor(Color.Red, Color.Brown); 120 //jama.Color = Color.Red; 121 jama.Hit(maiskeenlento); 122 Add(jama); 123 } 113 PhysicsObject jama = new PhysicsObject(RandomGen.NextInt(1, 5), RandomGen.NextInt(1, 5)); 114 jama.X = pelaaja.X; 115 jama.Y = pelaaja.Y; 116 Vector maiskeenlento = Vector.FromLengthAndAngle(RandomGen.NextDouble(0, 1000), RandomGen.NextAngle()); 117 jama.KineticFriction = 0.5; 118 jama.LinearDamping = 0.99; 119 jama.Color = RandomGen.NextColor(Color.Red, Color.Brown); 120 //jama.Color = Color.Red; 121 jama.Hit(maiskeenlento); 122 Add(jama); 124 123 } 125 // Vector maiskeenlento = new Vector();126 127 128 129 130 pelaaja.Image = null;131 pelaaja.Color = Color.Black;132 pelaaja.Size = new Vector(20, 5);133 124 } 125 126 pelaaja.Image = null; 127 pelaaja.Color = Color.Black; 128 pelaaja.Size = new Vector(20, 5); 129 hengissa = false; 130 // TODO: poista kontrollit... 134 131 } 135 132 } … … 242 239 // huijaus 243 240 Keyboard.Listen(Key.F2, ButtonState.Pressed, PelaajaMaahan, null); 241 Keyboard.Listen(Key.F3, ButtonState.Pressed, pelaajaMatalalle, null); 244 242 245 243 Keyboard.Listen(Key.Space, ButtonState.Pressed, AukaiseLaskuvarjo, "Aukaise laskuvarjo"); … … 261 259 pelaaja.Y = Level.Bottom + pelaaja.Height; 262 260 pelaaja.StopVertical(); 261 } 262 263 void pelaajaMatalalle() 264 { 265 pelaaja.Y = Level.Bottom + 1500; 263 266 } 264 267
Note: See TracChangeset
for help on using the changeset viewer.