Ignore:
Timestamp:
2014-07-02 10:22:36 (7 years ago)
Author:
mijoilmo
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.cs

    r5261 r5264  
    1212{ 
    1313    Player player; 
     14    ColorTileMap map; 
    1415    static public Dictionary<string, Image> images = new Dictionary<string, Image>(); 
    1516    void AssignKeys() 
     
    1718        Keyboard.Listen(Key.Escape, ButtonState.Down, Exit, "Lopeta Peli"); 
    1819        Keyboard.Listen(Key.Up, ButtonState.Down, player.thrusterStart, "Lento", 1.0); 
    19         Keyboard.Listen(Key.Up, ButtonState.Up, player.thrusterEnd, "Lento"); 
     20        Keyboard.Listen(Key.Up, ButtonState.Released, player.thrusterEnd, "Lento"); 
    2021        Keyboard.Listen(Key.Down, ButtonState.Down, player.thrusterStart, "Lento", -0.2); 
    21         Keyboard.Listen(Key.Down, ButtonState.Up, player.thrusterEnd, "Lento"); 
     22        Keyboard.Listen(Key.Down, ButtonState.Released, player.thrusterEnd, "Lento"); 
    2223        Keyboard.Listen(Key.Left, ButtonState.Down, player.rotate, "Lento", 4.0); 
    2324        Keyboard.Listen(Key.Right, ButtonState.Down, player.rotate, "Lento", -4.0); 
     
    2526    void LoadAllImages() 
    2627    { 
    27         images["background0"] = LoadImage("graphics/backgrounds/space_background"); 
    28         images["player"] = LoadImage("graphics/ships/player"); 
    29         images["tile0"] = LoadImage("graphics/tiles/tile0.png"); 
    3028        images["background0"] =                 LoadImage("graphics/backgrounds/space_background"); 
    3129        images["player"] =                      LoadImage("graphics/ships/player"); 
     
    4644        tileMap.SetTileMethod(Color.FromHexCode("000000"), createTile, ""); 
    4745        tileMap.SetTileMethod(Color.FromHexCode("ff0000"), spawnPlayer); 
    48         tileMap.Execute(20,20); 
    4946        tileMap.Execute(40,40); 
     47        map = tileMap; 
    5048    } 
    5149    void createTile(Vector position, double w, double h, string id) 
     
    6967        LoadAllImages(); 
    7068        this.player = new Player(); 
    71         LoadLevel("test"); 
     69        this.player.IsUpdated = true; 
     70        LoadLevel("0"); 
    7271    } 
    7372} 
Note: See TracChangeset for help on using the changeset viewer.