collisions while using moveto();?

Non-platform specific questions.

collisions while using moveto();?

Postby jimmynewguy » Tue Mar 16, 2010 11:02 am

Does anyone know a way i can do collisions while using the moveto(); funtion? It's for that rts game im making and i dont want "troops" to go inside eachother. It looks dumb and makes them hard to select just one :P
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: collisions while using moveto();?

Postby thunderios » Tue Mar 16, 2010 1:05 pm

Isn't there an argument that makes you dodge the specified object(s)?
I tested it, and the behave very funny if they're with ten of them XD But it's most likely not what you want.
You can also make an algorithm that will make your units go to certain positions depending on a number you give them when you select them: Selected[i] goes to
Code: Select all
x=(5 mod(i))*width;
y=bottom(i/5)*height;
Or something like that
thunderios
 
Posts: 87
Joined: Thu Jan 31, 2008 1:18 pm
Score: 1 Give a positive score

Re: collisions while using moveto();?

Postby jimmynewguy » Wed Mar 17, 2010 12:36 am

actually your post made me think of another way to do this, but thanks alot! i wouldnt have thought of it without you :)
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron