Ignore:
Timestamp:
2015-06-30 16:47:41 (8 years ago)
Author:
sieerinn
Message:

Tähtäysanimaatiot ja inventory äheltämistä.

File:
1 edited

Legend:

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

    r6549 r6617  
    66    public Dictionary<Direction, Animation> SwingAnimations { get; set; } 
    77 
    8     public Item ActiveItem { get; set; } 
     8    public Dictionary<Direction, Animation> ShootAnimations { get; set; } 
     9 
     10    public Item Sword { get; set; } 
     11 
     12    public Item ActiveItem 
     13    { 
     14        get 
     15        { 
     16            if (activeItemIndex < Inventory.Count) 
     17            { 
     18                return Inventory[activeItemIndex]; 
     19            } 
     20            return null; 
     21        } 
     22    } 
     23 
     24    private int activeItemIndex = 0; 
     25 
     26    public List<Item> Inventory { get; private set; } 
    927 
    1028    public Player() 
    1129        : base(TheLegendOfGabriel.TILE_SIZE, TheLegendOfGabriel.TILE_SIZE) 
    1230    { 
     31        Inventory = new List<Item>(); 
    1332        SwingAnimations = new Dictionary<Direction, Animation>(); 
     33        ShootAnimations = new Dictionary<Direction, Animation>(); 
    1434        CollisionIgnoreGroup = 1; 
     35    } 
     36 
     37    public void CycleItems() 
     38    { 
     39        activeItemIndex++; 
     40        if (activeItemIndex >= Inventory.Count) 
     41        { 
     42            activeItemIndex = 0; 
     43        } 
    1544    } 
    1645 
Note: See TracChangeset for help on using the changeset viewer.