Ignore:
Timestamp:
2015-07-01 16:20:43 (4 years ago)
Author:
empaheik
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel.cs

    r6692 r6697  
    347347    } 
    348348 
     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 
    349378    void UseItem(Item item, Item otherItem, Action action) 
    350379    { 
Note: See TracChangeset for help on using the changeset viewer.