- Timestamp:
- 2011-06-13 19:18:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/24/MiskaK/HaxPong/Pong/Pong/Peli.cs
r1964 r1977 36 36 LisaaLaskurit(); 37 37 38 38 39 39 40 … … 72 73 alaReuna = Level.CreateBottomBorder(); 73 74 alaReuna.Restitution = 1.0; 75 76 74 77 alaReuna.IsVisible = false; 75 78 … … 107 110 PhysicsObject LuoMaila( double x, double y ) 108 111 { 109 PhysicsObject maila = PhysicsObject.CreateStaticObject(20.0, 100.0);112 PhysicsObject maila = new PhysicsObject(20.0, 100.0); 110 113 maila.Shape = Shape.Rectangle; 111 114 maila.X = x; 112 115 maila.Y = y; 113 116 maila.Restitution = 1.0; 117 maila.CanRotate = false; 118 maila.Mass = 50000; 114 119 Add(maila); 115 120 … … 125 130 Keyboard.Listen(Key.Space, ButtonState.Down, Haxaa, null); 126 131 Keyboard.Listen(Key.LeftAlt, ButtonState.Pressed, Haxaa2, null); 132 Keyboard.Listen(Key.X, ButtonState.Pressed, Haxaa3, null); 127 133 128 134 … … 156 162 void Haxaa() 157 163 { 158 Vector impulssi = new Vector( 50.0, 0.0);164 Vector impulssi = new Vector(10.0, 0.0); 159 165 pallo.Hit(impulssi); 160 166 } … … 164 170 maila2.Destroy(); 165 171 172 } 173 174 void Haxaa3() 175 { 176 pelaajan1Pisteet.Value += 1; 177 166 178 } 167 179 … … 180 192 ylaReuna.Destroy(); 181 193 alaReuna.Destroy(); 194 pallo.Restitution = 1.2; 195 Gravity = new Vector(0.0, 0.0); 196 alaReuna.IgnoresCollisionResponse = false; 197 182 198 183 199 } … … 227 243 naytto.Color = Level.BackgroundColor; 228 244 Add(naytto); 245 laskuri.UpperLimit += PeliLoppui; 229 246 return laskuri; 230 247 248 249 250 } 251 252 void PeliLoppui(int arvo) 253 { 254 alaReuna.IgnoresCollisionResponse = true; 255 pallo.Restitution = 0.1; 256 Gravity = new Vector(0.0, -800.0); 257 Timer.SingleShot(2.0, Loppu); 258 } 259 260 void Loppu() 261 { 262 231 263 } 232 264
Note: See TracChangeset
for help on using the changeset viewer.