Changeset 1978
- Timestamp:
- 2011-06-13 20:24:50 (12 years ago)
- Location:
- 2011/24/MiskaK/HaxPong/Pong/Pong
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/24/MiskaK/HaxPong/Pong/Pong/Peli.cs
r1977 r1978 10 10 { 11 11 PhysicsObject pallo; 12 PhysicsObject meteoriitti; 13 12 14 13 15 Vector nopeusYlos = new Vector(0, 200); … … 25 27 PhysicsObject alaReuna; 26 28 29 IntMeter laskuri; 30 31 Image meteoriitinKuva = LoadImage("meteoriitti1"); 32 27 33 28 34 … … 35 41 AsetaOhjaimet(); 36 42 LisaaLaskurit(); 43 44 45 37 46 38 47 … … 129 138 Keyboard.Listen(Key.Z, ButtonState.Released, AsetaNopeus, null, maila1, Vector.Zero); 130 139 Keyboard.Listen(Key.Space, ButtonState.Down, Haxaa, null); 131 Keyboard.Listen(Key.LeftAlt, ButtonState.Pressed, Haxaa2, null); 140 Keyboard.Listen(Key.LeftAlt, ButtonState.Down, Haxaa2, null); 141 132 142 Keyboard.Listen(Key.X, ButtonState.Pressed, Haxaa3, null); 133 143 144 Keyboard.Listen(Key.S, ButtonState.Pressed, Haxaa4, null); 134 145 135 146 Keyboard.Listen(Key.Up, ButtonState.Down, AsetaNopeus, "Pelaaja 2: Liikuta mailaa ylös", maila2, nopeusYlos); … … 162 173 void Haxaa() 163 174 { 164 Vector impulssi = new Vector( 10.0, 0.0);175 Vector impulssi = new Vector(20.0, 0.0); 165 176 pallo.Hit(impulssi); 166 177 } … … 168 179 void Haxaa2() 169 180 { 181 182 Explosion räjähdys = new Explosion(500); 183 räjähdys.Position = maila2.Position; 184 185 Add(räjähdys); 186 170 187 maila2.Destroy(); 171 188 172 } 189 190 191 192 193 194 } 195 196 173 197 174 198 void Haxaa3() … … 178 202 } 179 203 204 void Haxaa4() 205 { 206 207 208 209 meteoriitti = new PhysicsObject(50.0, 50.0); 210 meteoriitti.Shape = Shape.Circle; 211 meteoriitti.X = 0.0; 212 meteoriitti.Y = 0.0; 213 Vector impulssi = new Vector(RandomGen.NextDouble(500.0, -500.0), RandomGen.NextDouble(500.0, -500.0)); 214 meteoriitti.Hit(impulssi); 215 meteoriitti.MaximumLifetime = TimeSpan.FromSeconds(10.0); 216 meteoriitti.Restitution = 2.0; 217 218 Add(meteoriitti); 219 220 } 221 180 222 181 223 … … 194 236 pallo.Restitution = 1.2; 195 237 Gravity = new Vector(0.0, 0.0); 196 alaReuna.IgnoresCollisionResponse = false;238 197 239 198 240 … … 233 275 IntMeter LuoPisteLaskuri( double x, double y ) 234 276 { 235 IntMeterlaskuri = new IntMeter(0);277 laskuri = new IntMeter(0); 236 278 laskuri.MaxValue = 10; 237 279 Label naytto = new Label(); … … 244 286 Add(naytto); 245 287 laskuri.UpperLimit += PeliLoppui; 288 246 289 return laskuri; 247 290 … … 260 303 void Loppu() 261 304 { 262 305 MessageDisplay.Add("Game Over!"); 263 306 } 264 307 -
2011/24/MiskaK/HaxPong/Pong/Pong/Pong.csproj
r1964 r1978 118 118 <Content Include="Game.ico" /> 119 119 <Content Include="GameThumbnail.png" /> 120 <Content Include="meteoriitti1.png" /> 120 121 </ItemGroup> 121 122 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.