So, I'm putting a sprite's previous positions in 2 lists, X and Y. I want it to end if you walk on one of the same pixels again, how would I do this quickly?
Offline
When Flag Clicked
forever
| if <not <Last X contains (x pos)> and <Last Y contains (y pos)>>
| |add (x pos) to list (Last X)
| |add (y pos) to list (Last Y)
| else _________________________________________________________
| stop all
| _____________________________________________________________
|______________________________________________________________
Last edited by johnnydean1 (2010-07-30 10:33:12)
Offline
But what if you are on 65, 34, and you have been on 65, 10, and 10, 34. It wouldn't allow you.
Offline
When Flag Clicked
forever
| if < <Last X contains (x pos)> and <Last Y contains (y pos)> >
| set index to 0.
| repeat until < <index = (length of (x pos) ) > or < index = true > >
| change index by 1.
| if < <(item index of Last X) = (x pos) and <(item index of Last Y) = (y pos) > >
| set index to true.
|_______________________
| if index = true
| stop all.
| else
| add (x pos) to Last X.
| add (y pos) to Last Y.
|______________________
|_________________________________________________
Last edited by johnnydean1 (2010-07-30 10:44:11)
Offline
When Flag Clicked
forever
| set X to item 1 of Prev. X.
| set Y to item 1 of Prev. Y.
| if < <Last X contains (X)> and <Last Y contains (Y)> >
| set index to 0.
| repeat until < <index = (length of (Last X) ) > or < index = true > >
| change index by 1.
| if < <(item index of Last X) = (X) and <(item index of Last Y) = (Y) > >
| set index to true.
|_______________________
| if index = true
| stop all.
| else
| add (Y) to Last X.
| add (X) to Last Y.
|______________________
| wait until < not < (x pos) = (X) > and < (y pos) = (Y)>
| delete 1 of Prev.X
| delete 1 of Prev.Y
|_________________________________________________
When Flag Clicked
forever
| add (x pos) to Prev. X
| add (y pos) to Prev. Y
| wait until < not < < (item last of Prev. X) = (x pos) and < (item last of Prev.Y) = (y pos.)
____________________________
Last edited by johnnydean1 (2010-07-30 10:56:39)
Offline