Changeset 1434 for 2010/30/jyniinin/SeppoPeli/Peli.cs
- Timestamp:
- 2010-07-30 11:34:38 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/jyniinin/SeppoPeli/Peli.cs
r1413 r1434 13 13 14 14 PlatformCharacter Seppo; 15 PlatformCharacter norsu;16 PlatformCharacter tahti;17 PlatformCharacter maali;18 15 PlatformCharacter AntiSeppo; 19 20 21 22 16 23 17 … … 79 73 Seppo.X = -200; 80 74 Seppo.Y = 120; 75 81 76 82 77 Add(Seppo); … … 108 103 ControllerOne.Listen(Button.DPadUp, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", Seppo, hyppyVoima); 109 104 ControllerOne.Listen(Button.X, ButtonState.Pressed, rajahdys, ""); 105 ControllerOne.Listen(Button.Y, ButtonState.Down, rajahdys5, ""); 106 ControllerOne.Listen(Button.RightTrigger, ButtonState.Down, teleport, ""); 107 ControllerOne.Listen(Button.LeftTrigger, ButtonState.Down, teleport3, ""); 108 ControllerOne.Listen(Button.RightStick, ButtonState.Down, seppotelettaa, ""); 109 ControllerOne.Listen(Button.RightShoulder, ButtonState.Down, muhahaa, ""); 110 110 111 111 112 ControllerTwo.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); … … 115 116 ControllerTwo.Listen(Button.DPadUp, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", AntiSeppo, hyppyVoima); 116 117 ControllerTwo.Listen(Button.X, ButtonState.Pressed, rajahdys2, ""); 118 ControllerTwo.Listen(Button.Y, ButtonState.Down, rajahdys6, ""); 119 ControllerTwo.Listen(Button.RightTrigger, ButtonState.Down, teleport2, ""); 120 ControllerTwo.Listen(Button.LeftTrigger, ButtonState.Down, teleport4, ""); 121 ControllerTwo.Listen(Button.RightStick, ButtonState.Down, antiseppotelettaa, ""); 122 ControllerTwo.Listen(Button.RightShoulder, ButtonState.Down, muhahaa2, ""); 117 123 118 124 119 125 ControllerOne.Listen(Button.Start, ButtonState.Pressed, restartti, "Aloita peli uudelleen"); 120 126 ControllerTwo.Listen(Button.Start, ButtonState.Pressed, restartti, "Aloita peli uudelleen"); 127 128 ControllerOne.Listen(Button.B, ButtonState.Down, HeitaKranaatti, ""); 129 ControllerTwo.Listen(Button.B, ButtonState.Down, HeitaKranaatti2, ""); 130 131 ControllerOne.Listen(Button.LeftShoulder, ButtonState.Pressed, poisto, ""); 132 ControllerTwo.Listen(Button.LeftShoulder, ButtonState.Pressed, poisto, ""); 133 134 ControllerOne.Listen(Button.LeftStick, ButtonState.Down, tuomio, ""); 135 ControllerTwo.Listen(Button.LeftStick, ButtonState.Down, tuomio, ""); 136 137 138 139 121 140 122 141 … … 139 158 Add(rajahdys); 140 159 rajahdys.Speed = 500.0; 141 rajahdys.Force = 1000;160 rajahdys.Force = 3000; 142 161 ControllerOne.Vibrate(99, 99, 99, 99, 0.1); 143 162 … … 150 169 Add(rajahdys); 151 170 rajahdys.Speed = 500.0; 152 rajahdys.Force = 1000;171 rajahdys.Force = 3000; 153 172 ControllerTwo.Vibrate(99, 99, 99, 99, 0.1); 154 173 } … … 178 197 } 179 198 199 void rajahdys5() 200 { 201 Explosion rajahdys = new Explosion(500.00); 202 rajahdys.Position = AntiSeppo.Position; 203 Add(rajahdys); 204 rajahdys.Speed = 50.0; 205 rajahdys.Force = 200; 206 ControllerTwo.Vibrate(99, 99, 99, 99, 0.1); 207 } 208 209 void rajahdys6() 210 { 211 Explosion rajahdys = new Explosion(500.00); 212 rajahdys.Position = Seppo.Position; 213 Add(rajahdys); 214 rajahdys.Speed = 50.0; 215 rajahdys.Force = 200; 216 ControllerOne.Vibrate(99, 99, 99, 99, 0.1); 217 } 218 180 219 void restartti() 181 220 { … … 189 228 } 190 229 191 230 void teleport2() 231 { 232 Gravity = new Vector(0, 1000); 233 } 234 235 void teleport() 236 { 237 Gravity = new Vector(0, 1000); 238 } 239 240 void teleport3() 241 { 242 Gravity = new Vector(0, -1000); 243 } 244 245 246 void teleport4() 247 { 248 Gravity = new Vector(0, -1000); 249 } 250 251 252 void HeitaKranaatti() 253 { 254 Grenade kranaatti = new Grenade(4.0); 255 kranaatti.X = Seppo.X + 10; 256 kranaatti.Y = Seppo.Y + 10; 257 Add(kranaatti); 258 Vector heittoVoima = Vector.FromLengthAndAngle(4000, Angle.Degrees(45)); 259 kranaatti.Hit(heittoVoima); 260 } 261 262 void HeitaKranaatti2() 263 { 264 Grenade kranaatti = new Grenade(4.0); 265 kranaatti.X = AntiSeppo.X - 10; 266 kranaatti.Y = AntiSeppo.Y - 10; 267 Add(kranaatti); 268 Vector heittoVoima = Vector.FromLengthAndAngle(4000, Angle.Degrees(45)); 269 kranaatti.Hit(heittoVoima); 270 } 271 272 void seppotelettaa() 273 { 274 Seppo.Position = RandomGen.NextVector(Level.Right, Level.Bottom, Level.Left, Level.Top); 275 } 276 277 void antiseppotelettaa() 278 { 279 AntiSeppo.Position = RandomGen.NextVector(Level.Right, Level.Bottom, Level.Left, Level.Top); 280 } 281 282 283 284 void muhahaa() 285 { 286 ClusterGrenade kranaatti = new ClusterGrenade(4.0, 2); 287 Add(kranaatti); 288 kranaatti.X = Seppo.X + 10; 289 kranaatti.Y = Seppo.Y + 10; 290 Vector heittoVoima = Vector.FromLengthAndAngle(4000, Angle.Degrees(45)); 291 kranaatti.Hit(heittoVoima); 292 293 kranaatti.NumberOfClusters = 4; 294 295 } 296 297 298 void muhahaa2() 299 { 300 ClusterGrenade kranaatti = new ClusterGrenade(4.0, 2); 301 Add(kranaatti); 302 kranaatti.X = AntiSeppo.X - 10; 303 kranaatti.Y = AntiSeppo.Y - 10; 304 Vector heittoVoima = Vector.FromLengthAndAngle(4000, Angle.Degrees(45)); 305 kranaatti.Hit(heittoVoima); 306 307 kranaatti.NumberOfClusters = 4; 308 309 } 310 311 312 void poisto() 313 { 314 ClearAll(); 315 Begin(); 316 } 317 318 void tuomio() 319 { 320 Grenade kranaatti = new Grenade(200.0); 321 kranaatti.Position = RandomGen.NextVector(Level.Right, Level.Bottom, Level.Left, Level.Top); 322 kranaatti.ExplosionForce = 9999999999999999999; 323 kranaatti.ExplosionSpeed = 55; 324 ControllerTwo.Vibrate(99, 99, 99, 99, 1.1); 325 ControllerOne.Vibrate(99, 99, 99, 99, 1.1); 326 327 328 Add(kranaatti); 329 Vector heittoVoima = Vector.FromLengthAndAngle(4000, Angle.Degrees(45)); 330 kranaatti.Hit(heittoVoima); 331 } 332 333 192 334 } 193 335
Note: See TracChangeset
for help on using the changeset viewer.