Changeset 6697 for 2015/27


Ignore:
Timestamp:
2015-07-01 16:20:43 (4 years ago)
Author:
empaheik
Message:
 
Location:
2015/27/ohjaajat/TheLegendOfGabriel
Files:
3 added
4 edited

Legend:

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

    r6632 r6697  
    1616    { 
    1717        Health = new IntMeter(health, 0, health); 
     18        Health.LowerLimit += delegate { this.Destroy(); }; 
    1819        MovementSpeed = new DoubleMeter(2000, 0, 2000); 
    1920        LastDirection = Direction.Down; 
  • 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs

    r6632 r6697  
    6666        enemy.Health.LowerLimit += enemy.Destroy; 
    6767 
    68         /* 
    69         Timer updateTimer = new Timer(); 
    70         updateTimer.Interval = 0.02; 
    71         updateTimer.Timeout += delegate 
    72         { 
    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         }); 
    11068    } 
    11169 
  • 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.