Map ClassDelta Engine Documentation
Loads and parses a map View code on GitHub
Inheritance Hierarchy

System Object
  TinyPlatformer Map

Namespace: TinyPlatformer
Assembly: TinyPlatformer (in TinyPlatformer.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public class Map

The Map type exposes the following members.

Constructors

  NameDescription
Public methodMap(String)
Initializes a new instance of the Map class
Public methodMap(JsonNode)
Initializes a new instance of the Map class
Top
Methods

  NameDescription
Public methodAddToScore
Top
Fields

  NameDescription
Public fieldStatic memberBlockSize
Public fieldStatic memberDefaultMaxVelocityX
Public fieldStatic memberMeter
Public fieldStatic memberScreenGap
Top
Properties

  NameDescription
Public propertyPlayer
Top
Remarks

Tests: TinyPlatformer.Tests.MapTests
Examples

7 unit tests call TinyPlatformer.Map
[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