The Dink Network

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

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
September 30th 2014, 10:31 AM
wizardg.gif
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.