Skip to content

Instantly share code, notes, and snippets.

@codepaladin
Last active August 29, 2015 14:01
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/4035d4415e2f1cec82b5 to your computer and use it in GitHub Desktop.
Save codepaladin/4035d4415e2f1cec82b5 to your computer and use it in GitHub Desktop.
-- get start position based off of startX and startY grid (cartesian) coordinates
function drawStart()
local x = (display.contentWidth * 0.5 + ((startX - startY) * tileHeight))
local y = (((startX + startY)/2) * tileHeight) - (tileHeight/2)
local myText = display.newText( "A", x, y, native.systemFont, 34 )
end
-- get end position based off of endX and endY grid (cartesian) coordinates
function drawEnd()
local x = (display.contentWidth * 0.5 + ((endX - endY) * tileHeight))
local y = (((endX + endY)/2) * tileHeight) - (tileHeight/2)
local myText = display.newText( "B", x, y, native.systemFont, 34 )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment