- Timestamp:
- 2015-07-01 16:20:43 (8 years ago)
- Location:
- 2015/27/ohjaajat/TheLegendOfGabriel
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/Creature.cs
r6632 r6697 16 16 { 17 17 Health = new IntMeter(health, 0, health); 18 Health.LowerLimit += delegate { this.Destroy(); }; 18 19 MovementSpeed = new DoubleMeter(2000, 0, 2000); 19 20 LastDirection = Direction.Down; -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs
r6632 r6697 66 66 enemy.Health.LowerLimit += enemy.Destroy; 67 67 68 /*69 Timer updateTimer = new Timer();70 updateTimer.Interval = 0.02;71 updateTimer.Timeout += delegate72 {73 if (!(enemy.Brain is FollowerBrain))74 {75 76 }77 enemy.UpdateCreature(Time);78 };79 updateTimer.Start();80 */81 }82 83 /// <summary>84 /// Luo pelaajan.85 /// </summary>86 void CreatePlayer(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties)87 {88 player = new Player();89 player.CanRotate = false;90 player.MovementSpeed = new DoubleMeter(2300, 0, 2300);91 player.Position = position;92 player.MoveAnimations = DirectionalAnimations(playerWalkLeft, playerWalkRight, playerWalkUp, playerWalkDown);93 player.SwingAnimations = DirectionalAnimations(playerSwingLeft, playerSwingRight, playerSwingUp, playerSwingDown);94 player.ShootAnimations = DirectionalAnimations(playerShootLeft, playerShootRight, playerShootUp, playerShootDown);95 player.Image = playerWalkDown.CurrentFrame;96 Add(player, 1);97 98 player.Sword = new Sword(player);99 player.Inventory.Add(new Pistol(player));100 player.Inventory.Add(new Monocle(player));101 player.Inventory.Add(new Grenade(player));102 103 player.Health.Value = 3; // Alkuun vain kolme sydäntä.104 105 AddCollisionHandler(player, "exit", CollidesWithExit);106 AddCollisionHandler(player, "enemy", delegate(PhysicsObject p, PhysicsObject e)107 {108 player.Health.Value--;109 });110 68 } 111 69 -
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs
r6692 r6697 347 347 } 348 348 349 /// <summary> 350 /// Luo pelaajan. 351 /// </summary> 352 void CreatePlayer(Vector position, double width, double height, Angle angle, Shape shape, string name, Dictionary<string, string> properties) 353 { 354 player = new Player(); 355 player.CanRotate = false; 356 player.MovementSpeed = new DoubleMeter(2300, 0, 2300); 357 player.Position = position; 358 player.MoveAnimations = DirectionalAnimations(playerWalkLeft, playerWalkRight, playerWalkUp, playerWalkDown); 359 player.SwingAnimations = DirectionalAnimations(playerSwingLeft, playerSwingRight, playerSwingUp, playerSwingDown); 360 player.ShootAnimations = DirectionalAnimations(playerShootLeft, playerShootRight, playerShootUp, playerShootDown); 361 player.Image = playerWalkDown.CurrentFrame; 362 Add(player, 1); 363 364 player.Sword = new Sword(player); 365 player.Inventory.Add(new Pistol(player)); 366 player.Inventory.Add(new Monocle(player)); 367 player.Inventory.Add(new Grenade(player)); 368 369 player.Health.Value = 3; // Alkuun vain kolme sydäntä. 370 371 AddCollisionHandler(player, "exit", CollidesWithExit); 372 AddCollisionHandler(player, "enemy", delegate(PhysicsObject p, PhysicsObject e) 373 { 374 player.Health.Value--; 375 }); 376 } 377 349 378 void UseItem(Item item, Item otherItem, Action action) 350 379 {
Note: See TracChangeset
for help on using the changeset viewer.