Detect "collision" without physics

I am building a game where I use the theories presented by Jesse Warden here to create a screen full of vector tiles.

--Class to place tiles Tile = {} function Tile:new( startX, startY, number ) local group = display.newGroup(); local tile = display.newRect( 0, 0, 64, 64 ); tile:setReferencePoint( display.TopLeftReferencePoint ); tile:setFillColor( 0, 255, 0 ); tile.id = 1; tile.x = startX; tile.y = startY; -- listener for touch, move the player object accordingly local touchListener = function( event ) local X = event.x; local Y = event.y; print( "####Clicked Positon####") print( "X: " .. X ); print( "Y: " .. Y ); print( "Tile ID: " .. tile.id ); player:walk( X, Y ); end tile:addEventListener( "tap", touchListener ); group:insert( tile ); return group; end return Tile;

I have another module that creates a player object in a similar fashion. When one of the tiles is clicked, the player object moves to that location via a transition.to call. My question is, how can I detect which tile the player object is on at any given time, along with targeting said tile?

The end result is to have the player object move toward the target location by only stepping on designated squares. I believe I have that logic all worked out, except I am unsure of how to detect what tile he is on at any given time without using physics. An additional feature would be to have the player object passing over a tile trigger that tile to be destroyed.

Since there are 768 of these tiles on the screen at any one time, I didn’t want to make them all physics bodies. I’ve been looking through documentation on creating custom event listeners, but am unsure what exactly to listen for during the player objects journey to the new location.

Here is documentation on collision detection without physics:

http://www.coronalabs.com/blog/2013/07/23/tutorial-non-physics-collision-detection/

A google search will yield several different solutions to this issue.

Gratzie! The simplest solution is often the one we overlook.

Here is documentation on collision detection without physics:

http://www.coronalabs.com/blog/2013/07/23/tutorial-non-physics-collision-detection/

A google search will yield several different solutions to this issue.

Gratzie! The simplest solution is often the one we overlook.