The Dink Network

Reply to Re: Making sprites avoid each other

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:
 
 
February 12th 2011, 04:05 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
What I would do is use Pythagora's theorem to determine an accurate distance, then have it set to move a random direction in a random direction within a 180 degree arc away from it(So if the sprite to avoid was at 0 degrees, the other sprite would then pick a random path between +90 degrees and -90/270 degrees) If there is no random function, you could always use time commands, as they are rarely entirely accurate and you can use these innacuracies to get psuedorandom values.

Also, kinda relevant, but can a sprite actually move in all directions or only eight?