The Dink Network

best way to get a sprite walking continously walking a straight line in a random direction

September 28th 2014, 07:46 AM
knights.gif
merder
Peasant He/Him Netherlands
The Voice in the back of your head! 
as the name implies what is the best way to make a sprite walk in straight line but a random direction(so no direction turning whatsoever.

i'm assuming missile brains but those can zoom across the screen and dunno if they can work as a target which is what i need them as moving targets.

what for i need i won't reveal yet but you can knock yourself out by trying to guess
September 28th 2014, 10:29 AM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Do you want them to move off screen?
September 30th 2014, 08:01 AM
knights.gif
merder
Peasant He/Him Netherlands
The Voice in the back of your head! 
jup but unlike in other mods i will make 'm appear o n the other side(for nicest effect will teleport them with x or y code just outside so they walk back on (shh will be a weird dmod tho with dink sprites will be like a known arcade game))
September 30th 2014, 10:31 AM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Huh.

I would probably call a random for all the directions the sprites can go in, then create the sprite. Next give that sprite a script that's sole purpose is to move a sprite in a specific direction. Use a move_stop in that script and make sure the sprite just barely moves off screen. Then I'd alter the coordinates so it was on the opposite side of the map and continue to move it. Alternatively if I wanted it to look like the sprite was coming on screen as it was going off screen I'd create a new sprite off screen with coordinates so it moved with the sprite onscreen. Might be a bit trickier to determine the coordinates of a diagonal moving sprite. That's what I would do.
October 1st 2014, 12:38 PM
knights.gif
merder
Peasant He/Him Netherlands
The Voice in the back of your head! 
thx i'll see what i can do with this and well hope script numbers don't get too high but with how i;m setting it up not many monsters scripts and mostly will be some stores and such but will see how it works out(seen the engine can handle all that is needed for the plan and if finished hope dinkers will enjoy