Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / having a problem with multiple pathed objects movement

Author
Message
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 12th Feb 2018 06:30 Edited at: 12th Feb 2018 06:34
I have used my path editor from https://forum.thegamecreators.com/thread/221096

To create the following path file


I am using it with an array of up to 50 moveable sprites
firstly I position them like

they were created using my tested tile editor available here
https://forum.thegamecreators.com/thread/219932

then i load my path for each enemy in the arrray


here is where i beleive i have the problem
when movepath is called they move very jittery
enemySprite[num,0].x holds the original x location of the sprite
enemySprite[num,0].y holds the original y location


I'm sure there is something crazy ive done and there is some simple logic problem but they dont even seem to follow the path
as it steps through the array ive stopped the background movement to debug it as that changes the original location but still is very
Jittery. I haven't sent the whole code as it really needs the graphics to get it to work as they were positioned in each location by the tile
editor and because of copyrights but I can place the full code if that helps without the sprites if that helps

and the count should hold the value of which path item should be applied
fubar
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 7th Mar 2018 05:33
I fixed the problem by changing move path to move enemy now instead of a two dimensional array
I have 2 one dimensional arrays one for the enemy and one for the paths adventually in the enemy are
it will just point to where the path
fubar
fubarpk
Moderator
14
Years of Service
Recently Online
Joined: 11th Jan 2005
Location: Adelaide
Posted: 7th Mar 2018 05:48 Edited at: 7th Mar 2018 06:12
For the time being all tank objects are set to use the same path
Im not sure wether it is just better to have them follow a road



For those interested the following code is how its done


and the arraypath1.file like


no point sharing the level1.txt as that uses my tiles

The map is also a continuous looping map that I may keep looping until a set number of kills etc

I will adventually need to probably combine the tile editor with the path editor so you can lay out
paths when creating a map
fubar

Login to post a reply

Server time is: 2019-04-26 12:01:09
Your offset time is: 2019-04-26 12:01:09