Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- include the jumper library
local Grid = require ("jumper.jumper.grid")
local Pathfinder = require ("jumper.jumper.pathfinder")
local walkable = 0 -- used by Jumper to mark obstacles
local map = {} -- table representing each grid position
local startX = 1 -- start x grid (cartesian) coordinate
local startY = 1 -- start y grid (cartesian) coordinate
local endX = 3 -- end x grid (cartesian) coordinate
local endY = 4 -- end y grid (cartesian) coordinate
local tileWidth = 128
local tileHeight = 64
local bg = display.newRect( display.screenOriginX,
display.screenOriginY,
display.actualContentWidth,
display.actualContentHeight)
bg.x = display.contentCenterX
bg.y = display.contentCenterY
bg:setFillColor( 000/255, 168/255, 254/255 )
-- display group that will hold grid
group = display.newGroup( )
group.x = display.contentCenterX -- center the grid on the screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment