Changeset 2206 for 2011/26


Ignore:
Timestamp:
2011-06-28 12:21:32 (8 years ago)
Author:
teeevasa
Message:

Talletus.

Location:
2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Enemy.cs

    r2205 r2206  
    88public class Enemy : GenCharacter 
    99{ 
    10     public Enemy(double width, double height, Shape shape) 
     10    public Enemy(double width, double height, Shape shape, int HP) 
    1111        : base(width, height, shape) 
    1212    { 
    13  
     13        hitPoints = HP; 
    1414    } 
    1515} 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/GenCharacter.cs

    r2205 r2206  
    88public class GenCharacter : PlatformCharacter 
    99{ 
     10    protected int hitPoints 
     11    { 
     12        get { return hitPoints; } 
     13        set { hitPoints = value; } 
     14    } 
     15 
     16    protected int maxHP 
     17    { 
     18        get { return maxHP; } 
     19    } 
     20 
    1021    public GenCharacter(double width, double height, Shape shape) 
    1122        : base(width, height, shape) 
     
    1324 
    1425    } 
     26 
     27    private void reduceHitPointsBy(int reduction) 
     28    { 
     29        hitPoints -= reduction; 
     30    } 
    1531} 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Peli.cs

    r2197 r2206  
    99public class Peli : PhysicsGame 
    1010{ 
    11     /*const double nopeus = 200; 
     11    const double nopeus = 200; 
    1212    const double hyppyNopeus = 1000; 
    1313    const int RUUDUN_KOKO = 40; 
     
    1818    Image tahtiKuva = LoadImage("tahti"); 
    1919 
    20     SoundEffect maaliAani = LoadSoundEffect("maali");*/ 
     20    SoundEffect maaliAani = LoadSoundEffect("maali"); 
     21 
     22    Player player; 
    2123 
    2224    public override void Begin() 
     
    3234    } 
    3335 
    34     /*void luoKentta() 
     36    void luoKentta() 
    3537    { 
    3638        TileMap kentta = TileMap.FromFile("kentta1.txt"); 
     
    101103            kohde.Destroy(); 
    102104        } 
    103     }*/ 
     105    } 
    104106} 
  • 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Player.cs

    r2205 r2206  
    88public class Player : GenCharacter 
    99{ 
     10    const int speed = 200; 
     11 
    1012        public Player(double width, double height, Shape shape) 
    1113        : base(width, height, shape) 
    1214        { 
     15        hitPoints = 100; 
     16        addControls(); 
     17        } 
    1318 
    14         } 
     19    public void addControls() 
     20    { 
     21        Keyboard.Listen(Key.Right, ButtonState.Down, "Move right", speed); 
     22    } 
    1523} 
Note: See TracChangeset for help on using the changeset viewer.