Hi,
I was interested in making a game similar to Bejewled, with the exception of allowing the user to move the actual jewel more than one position over. I was wondering how I could accomplish moving the gem smoothly, while still having a fixed position.
This is my current code to make the objects have a fixed position, but anytime I put the object within the boundries of any of the coordinates, it instantly locks to that location instead of smoothly moving to it. Would a physics engine of some sort be required?
[lua]
– This is the current code to force the fixed positions.
if(x <= 160 and y <= 240) then
x = 80
y = 120
elseif(x >= 160 and y <= 240) then
x = 240
y = 120
elseif(x<= 160 and y >= 240) then
x = 80
y = 360
elseif(x>= 160 and y >= 240) then
x = 240
y = 360
end
[/lua]
Thanks,
Matt