Ignore:
Timestamp:
2015-06-29 16:51:35 (6 years ago)
Author:
sieerinn
Message:

Uusi testikenttä. Osa tiilistä voi olla PhysicsObjecteja?.

File:
1 edited

Legend:

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

    r6536 r6538  
    77public partial class TheLegendOfGabriel : PhysicsGame 
    88{ 
     9    /// <summary> 
     10    /// Luo pelaajan. 
     11    /// </summary> 
     12    void CreatePlayer(Vector position) 
     13    { 
     14        player = new Creature(TILE_SIZE, TILE_SIZE); 
     15        player.MovementSpeed = 2300; 
     16        player.Position = position; 
     17        Add(player); 
     18    } 
     19 
    920    /// <summary> 
    1021    /// Luo kentän .tmx tiedostosta. 
     
    2132 
    2233    /// <summary> 
    23     /// Maassa oleva perus tiili, jonka läpi voi kävellä. 
     34    /// Maassa oleva perus tiili. 
    2435    /// </summary> 
    25     void CreateBaseTile(Vector position, double width, double height, Image image, string layerName) 
     36    void CreateBaseTile(Vector position, double width, double height, Image image, string layerName, Dictionary<string, string> properties) 
    2637    { 
    27         CreateBasicTile(position, width, height, image, -1); 
     38        CreateBasicTile(position, width, height, image, -1, properties); 
    2839    } 
    2940 
     
    3142    /// Pelaajan päällä näkyvä perus tiili. 
    3243    /// </summary> 
    33     void CreateForegroundTile(Vector position, double width, double height, Image image, string layerName) 
     44    void CreateForegroundTile(Vector position, double width, double height, Image image, string layerName, Dictionary<string, string> properties) 
    3445    { 
    35         CreateBasicTile(position, width, height, image, 1); 
     46        CreateBasicTile(position, width, height, image, 1, properties); 
    3647    } 
    3748 
    3849    /// <summary> 
    39     /// Luo tavallisen tiilen jonka läpi voi kävellä. 
     50    /// Luo tavallisen tiilen. 
    4051    /// </summary> 
    41     void CreateBasicTile(Vector position, double width, double height, Image image, int layer) 
     52    void CreateBasicTile(Vector position, double width, double height, Image image, int layer, Dictionary<string, string> properties) 
    4253    { 
    43         var tile = new GameObject(width, height); 
     54        var tile = properties.ContainsKey("collide")? new PhysicsObject(width, height) : new GameObject(width, height); 
    4455        tile.Image = image; 
    4556        tile.Position = position; 
Note: See TracChangeset for help on using the changeset viewer.