Loads and parses a map
View code on GitHub
Inheritance Hierarchy
TinyPlatformer Map
Namespace: TinyPlatformer
Assembly: TinyPlatformer (in TinyPlatformer.exe) Version: 1.1.1.0 (1.1.1)
Syntax
The Map type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | Map(String) | Initializes a new instance of the Map class |
![]() | Map(JsonNode) | Initializes a new instance of the Map class |
Methods
Name | Description | |
---|---|---|
![]() | AddToScore |
Fields
Name | Description | |
---|---|---|
![]() ![]() | BlockSize | |
![]() ![]() | DefaultMaxVelocityX | |
![]() ![]() | Meter | |
![]() ![]() | ScreenGap |
Properties
Name | Description | |
---|---|---|
![]() | Player |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void CheckMapSize() { Assert.AreEqual(8, map.width); Assert.AreEqual(6, map.height); }
[Test, CloseAfterFirstFrame] public void CheckMapContent() { Assert.AreEqual(BlockType.LevelBorder, map.Blocks[0, 0]); Assert.AreEqual(BlockType.None, map.Blocks[1, 1]); }
[Test, CloseAfterFirstFrame] public void CheckEntityLoading() { Assert.AreEqual(1, map.actorList.FindAll(actor => actor.type == "player").Count); Assert.AreEqual(1, map.actorList.FindAll(actor => actor.type == "monster").Count); Assert.AreEqual(1, map.actorList.FindAll(actor => actor.type == "treasure").Count); }
See Also