3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Click and Move targeting chain...
[Re: lostclimate]
#259452
04/06/09 08:05
04/06/09 08:05
|
Joined: Jul 2007
Posts: 50
Nomad
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2007
Posts: 50
|
|
|
|
Re: Click and Move targeting chain...
[Re: Nomad]
#259640
04/07/09 01:46
04/07/09 01:46
|
Joined: Oct 2005
Posts: 4,771 Bay City, MI
lostclimate
Expert
|
Expert
Joined: Oct 2005
Posts: 4,771
Bay City, MI
|
well the basic theory is this
000000000 123456789
lets say each of those are values in the array and 0 is empty
so you put a new position, lets say 1 in the array
100000000 123456789
so you go through the array and make the first one in the row a 1 and then they click again, so you get to point 2
120000000 123456789
now you have 2 pts in the array. now lets say your character gets to pt 1, you remove it from the array
020000000 123456789
and then go thru each of the values and move it up one more slot so that they are next in line
200000000 123456789
that way they will go to point 2 next.
That is just one way to do it, but if you practice with arrays you will learn several ways to do it. You might want to google things such as stack's, deque's, queues, bubble searches and binary searches. They are all programming techniques for manipulating an array.
now you click some where else in the array
|
|
|
Re: Click and Move targeting chain...
[Re: lostclimate]
#259646
04/07/09 03:08
04/07/09 03:08
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
in other words, hes trying to get you to do this:
array clickarray[500];// allows you to click up to 500 times before it cant store anymore
when you click, it will store your first co-ordinates xyz(134,543,0) in the first slot. when you click again, your next set of xyz will be put it into the second slot, until the first point is reached, then its erased; and player goes for the second set of numbers(which becomes the first set of numbers now)
if you clicked 3 times before you reach destination 1, your array will store 3 sets of xyz... make sense?
Visual image...
clickarray[500] //New array made, looks like this: 0,0,0,0,0,0,0,0,0,0,0,0,0....500 times
click once, it looks like: (134,543,0),0,0,0,0,0,0,0,0,0,0,0...
and if you click again before you get to target one: (134,543,0),(265,789,0),0,0,0,0,0,0,0,0,0...
and if you reach target one, and click again, like this: (265,789,0),(325,762,0),0,0,0,0,0,0,0,0...
so you can click up to 500 times until it cant store the last number...
I dont know how to delete the numbers in array slot 1, without deleting the whole array tho...
Good luck.
Last edited by DevoN; 04/07/09 03:09.
|
|
|
|