Ignore:
Timestamp:
2011-12-10 15:50:27 (8 years ago)
Author:
hniemi
Message:

Lisätty alkuvalikot ja eventti voittamiselle. Voittaminen on kivaa.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2010/23/hniemi/BlockPusher/Blockpusher/Blockpusher/BlockLevel.cs

    r2633 r2634  
    66using Jypeli; 
    77 
     8/// <summary> 
     9/// Class that holds information of level and players location 
     10/// Also handles movement of player. 
     11/// </summary> 
    812public class BlockLevel 
    913{ 
     
    1620    private int playerY; 
    1721 
     22    public delegate void GameEvent(); 
     23    public event GameEvent Victory; 
     24 
     25    /// <summary> 
     26    /// Height of the playfield 
     27    /// </summary> 
    1828    public int PlayfieldHeight { get { return playfield.GetLength(1); } } 
     29    /// <summary> 
     30    /// Width of the playfield 
     31    /// </summary> 
    1932    public int PlayfieldWidth { get { return playfield.GetLength(0); } } 
    2033 
     
    120133            if (!(item.Type == BlockType.SatisfiedGoalZone)) return false; 
    121134        } 
     135        if (Victory != null) Victory(); 
    122136        return true; 
    123137    } 
     
    136150    } 
    137151 
     152    /// <summary> 
     153    /// Creates playfield from given list of strings 
     154    /// </summary> 
     155    /// <param name="level"></param> 
    138156    public void CreateField(List<string> level) 
    139157    { 
Note: See TracChangeset for help on using the changeset viewer.