Skip to content
Caleb Place edited this page Feb 5, 2014 · 2 revisions

Want to get a map on-screen as soon as possible? Just follow these instructions and you'll be using Dusk in no time.

Get the Code

Download the ZIP archive from GitHub, expand, and copy the engine folder (named "Dusk") into your project's root directory (the one with main.lua in it).

Include the Library

In your scene, add the following line:

local dusk = require("Dusk.Dusk")

Build a Map

Make a Tiled map and export it as JSON, then load it with the following:

local map = dusk.buildMap("path/to/map.json")

Make sure you include your extension!

Run Your Code

Run it in the Corona Simulator! Presto! A map.

More Stuff

  • The map is a display object, so you can move it around, scale it, fade it in and out, or whatever else you want
  • You can access a layer with map.layer["layer name"] or map.layer[index]
  • Dusk has a built-in camera system inside it; to make objects move according to it, you'll have to insert them into a map layer (map.layer[whatever]:insert(obj))
  • Call map.updateView() in your enterFrame listener to make the camera system and culling work, otherwise, it'll appear that any part of the map that's off the screen has disappeared (it has...)