Changeset 6538 for 2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs
- Timestamp:
- 2015-06-29 16:51:35 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/ohjaajat/TheLegendOfGabriel/TheLegendOfGabriel/TheLegendOfGabriel/LevelCreation.cs
r6536 r6538 7 7 public partial class TheLegendOfGabriel : PhysicsGame 8 8 { 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 9 20 /// <summary> 10 21 /// Luo kentän .tmx tiedostosta. … … 21 32 22 33 /// <summary> 23 /// Maassa oleva perus tiili , jonka läpi voi kävellä.34 /// Maassa oleva perus tiili. 24 35 /// </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) 26 37 { 27 CreateBasicTile(position, width, height, image, -1 );38 CreateBasicTile(position, width, height, image, -1, properties); 28 39 } 29 40 … … 31 42 /// Pelaajan päällä näkyvä perus tiili. 32 43 /// </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) 34 45 { 35 CreateBasicTile(position, width, height, image, 1 );46 CreateBasicTile(position, width, height, image, 1, properties); 36 47 } 37 48 38 49 /// <summary> 39 /// Luo tavallisen tiilen jonka läpi voi kävellä.50 /// Luo tavallisen tiilen. 40 51 /// </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) 42 53 { 43 var tile = new GameObject(width, height);54 var tile = properties.ContainsKey("collide")? new PhysicsObject(width, height) : new GameObject(width, height); 44 55 tile.Image = image; 45 56 tile.Position = position;
Note: See TracChangeset
for help on using the changeset viewer.