Page 1 of 1

moving along a path

Posted: Sun Apr 06, 2014 8:26 pm
by rokit boy
ive used jumper and now i have a table full of coordinates for my character to move to one by one.
i just cant figure out how to make him move to one, stop, move to another, stop etc.

help please?

Re: moving along a path

Posted: Mon Apr 07, 2014 4:46 am
by Jasoco
Depends. Are the points/is the game on a grid or do you want it to be able to move freely at non-orthogonal angles?

Re: moving along a path

Posted: Mon Apr 07, 2014 3:49 pm
by rokit boy
Jasoco wrote:Depends. Are the points/is the game on a grid or do you want it to be able to move freely at non-orthogonal angles?
on a grid.
map:

Code: Select all

	map = { -- 0 empty 1 rock 2 water
	{1,1,1,1,1,1,1,1}, 
	{1,0,0,0,1,0,0,1},
	{1,1,1,0,1,0,1,1},
	{1,0,1,0,1,0,1,1},
	{1,0,0,0,0,0,1,1},
	{1,1,1,1,0,0,0,1},
	{1,0,0,0,0,1,0,1},
	{1,1,1,1,1,1,1,1},
	}

Re: moving along a path

Posted: Mon Apr 07, 2014 6:25 pm
by Roland_Yonaba
Hi Rokit,

Have you studied the example of project I provided with Jumper ?
The code is quite old, and uses an old version of Jumper, but the logic stays the same.
See Jumper-Examples/Love2d branch. Most of the logic you need is in player.lua.
Adding the wait _for_some_time_before_moving feature should not be that hard to implement on the top of it :)

Re: moving along a path

Posted: Sun Apr 27, 2014 1:57 pm
by rokit boy
Roland_Yonaba wrote:Hi Rokit,

Have you studied the example of project I provided with Jumper ?
The code is quite old, and uses an old version of Jumper, but the logic stays the same.
See Jumper-Examples/Love2d branch. Most of the logic you need is in player.lua.
Adding the wait _for_some_time_before_moving feature should not be that hard to implement on the top of it :)
i did look over it but i can't find a way to implement it into mine sorry.