moving along a path

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

moving along a path

Post 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?
u wot m8
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: moving along a path

Post 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?
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

Re: moving along a path

Post 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},
	}
u wot m8
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: moving along a path

Post 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 :)
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

Re: moving along a path

Post 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.


Last bumped by rokit boy on Sun Apr 27, 2014 1:57 pm.
u wot m8
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], slime and 8 guests