Skip to content

Instantly share code, notes, and snippets.

@codepaladin
Created May 26, 2014 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codepaladin/8dc3511c2c5b6b4044ad to your computer and use it in GitHub Desktop.
Save codepaladin/8dc3511c2c5b6b4044ad to your computer and use it in GitHub Desktop.
-- 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