import "graphics" for Canvas, Color, ImageData, Point, Font
import "dome" for Process, Window, Platform
import "io" for FileSystem
import "./tilekit-helper"
var OurMap = TileMap.new("map.json")
class Main {
construct new() {}
init() {
Canvas.resize(OurMap.width * OurMap.tileWidth, OurMap.height * OurMap.tileHeight)
}
update() {}
draw(alpha) {
OurMap.draw(0, 0)
}
}
var Game = Main.new()
An instance of TileMap
class contains information about a map created with TileKit. It can be used to easily manipulate, process, and draw the map the the Canvas.
Creates a new instance of a TileMap object. String
should be in same directory as this module.
Width of tilemap in tiles
Height of tilemap in tiles
Width of tiles in pixels
Height of tiles in pixels
Returns tile at map coordinates (x, y)
Sets tile at map coordinates (x, y)
Draw a single tile
to Canvas at (x, y)
drawArea(startX: Number, startY: Number, width: Number, height: Number, destX: Number, destY: Number)
Draw a subsection of the map at (startX, startY) to (destX, destY) on Canvas
Draws entire TileMap to Canvas at (x, y)