Changeset 2639 for 2010


Ignore:
Timestamp:
2011-12-27 18:22:59 (8 years ago)
Author:
hniemi
Message:

Lisätty siirtojen laskeminen

Location:
2010/23/hniemi/BlockPusher/Blockpusher/Blockpusher
Files:
2 edited

Legend:

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

    r2636 r2639  
    2020    private int playerY; 
    2121 
     22    private int parMoves; 
     23 
    2224    public delegate void GameEvent(); 
    2325    public event GameEvent Victory; 
     
    3638    /// </summary> 
    3739    public string Name { get; set; } 
     40 
     41    public int Moves { get; set; } 
    3842 
    3943    /// <summary> 
     
    8892                    playerX += x; 
    8993                    playerY += y; 
     94                    Moves++; 
    9095                } 
    9196 
     
    96101                playerX += x; 
    97102                playerY += y; 
     103                Moves++; 
    98104                break; 
    99105            default: 
    100106                break; 
    101107        } 
    102  
    103         if (VictoryCheck()) 
    104         { 
    105             //TODO Insert Event 
    106             //MessageDisplay.Add("You Win!"); 
    107         } 
     108         
     109        VictoryCheck(); 
    108110    } 
    109111 
  • 2010/23/hniemi/BlockPusher/Blockpusher/Blockpusher/Blockpusher.cs

    r2638 r2639  
    150150    { 
    151151        IsMouseVisible = true; 
    152         MultiSelectWindow w = new MultiSelectWindow("Conratulations! Do you want to:", new String[] { "Retry", "Next Level", "Main menu" }); 
     152        MultiSelectWindow w = new MultiSelectWindow("Conratulations, you cleared level with "+ currentLevel.Moves +" moves! Do you want to:", new String[] { "Retry", "Next Level", "Main menu" }); 
    153153        w.AddItemHandler(0, delegate { NewGame(currentLevelIndex); }); 
    154154        w.AddItemHandler(1, delegate { NewGame((currentLevelIndex+1) % levels.Count); }); 
Note: See TracChangeset for help on using the changeset viewer.