- Timestamp:
- 2015-06-23 21:28:35 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6211 r6212 35 35 } 36 36 37 public HillBilly(double leveys, double korkeus, HillbillyRun game) 37 38 39 public HillBilly(double leveys, double korkeus) 38 40 : base(leveys, korkeus) 39 41 { … … 244 246 flame.Animation.Start(); 245 247 Add(flame); 248 249 Smoke savu = new Smoke(); 250 savu.Position = flame.Position; 251 Add(savu); 246 252 } 247 253 … … 259 265 milk.Image = milkImage; 260 266 milk.Position = position; 267 milk.Tag = "milk"; 261 268 Add(milk); 262 269 } … … 336 343 void CreatePlayer(Vector position, double width, double height) 337 344 { 338 HillBilly player = new HillBilly(width, height * 2 , this);345 HillBilly player = new HillBilly(width, height * 2); 339 346 player.Shape = Shape.Rectangle; 340 347 player.Position = position + new Vector(0, height * 0.5); … … 347 354 HillBilly billy = p as HillBilly; 348 355 billy.Life.Value--; 356 349 357 } 350 358 ); 351 359 352 player.Life.LowerLimit += delegate { players.Remove(player); player.Destroy(); }; 360 player.Life.LowerLimit += delegate 361 { 362 players.Remove(player); player.Destroy(); 363 if (players.Count < 1) 364 { 365 Loss(); 366 } 367 }; 353 368 } 354 369 … … 380 395 } 381 396 382 void CreateGround(Vector position, double width, double height) //TODO: Fiksataan se, että pelihahmot tietysti luiskahtavat tästä läpi, mikäli pääsevät sen sivustaan. Muitakin korjaustapoja tietty on, kuin tässä aliohjelmassa operoiminen.383 { 384 GameObject ground = new GameObject(width, height);397 void CreateGround(Vector position, double width, double height) 398 { 399 PhysicsObject ground = PhysicsObject.CreateStaticObject(width, height); 385 400 ground.Image = groundTopImages[levelNumber]; 386 401 ground.Position = position; … … 402 417 Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Show help"); 403 418 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Exit game"); 419 } 420 421 void Loss() 422 { 423 //TODO: Sumthin' flashy for our fallen friends. 424 Exit(); 404 425 } 405 426
Note: See TracChangeset
for help on using the changeset viewer.