Grid Alert

Posted by Shawnanator on March 11, 2006, 9:43 a.m.

Grid Alert is the name for my new RTS.

I just got one problem.

A base creates an enemy unit every so offten. But when it creates anotherone, it overlaps the other unit… How can i make it so the units slowly spread away from eachother?

Comments

Maxcore 18 years, 1 month ago

have it creat the units around the base like on a cirlcle (will require trig) then have them more in the opposite direction of the base, slowly.

ludamad 18 years, 1 month ago

I have a code that makes the units spread out, somewhere. It isn't hard.

Shawnanator 18 years, 1 month ago

Ludamad, can you type me up a code? Can you find the code?

Shawnanator 18 years, 1 month ago

Or anyone?

Xemrel 18 years, 1 month ago

var thing;

instance_deactivate(self);

thing=instance_nearest(x,y,object_index);

instance_activate(self);

if(point_distance(x,y,thing.x,thing.y)<10)motion_add(point_direction(x,y,thing.x,thing.y),0.1);

That's off the top of my head, and I didn't type it into GM, so there may be typos, but it should at least give you the idea. Basically, it turns itself off, first, so instance nearest doesn't just return the unit itself, finds out which other unit (of the same type, but that's easily changed) is close, and accelerates away from it if it's <i>too</i> close. This assumes that the units have friction, otherwise, they'll just keep zooming away forever. ^_^ You can always change that, though.

Alpha Man 18 years, 1 month ago

You so ripped off of Westwood Studios, didn't you?

Indeed you did.

Shawnanator 18 years, 1 month ago

Hmmmm… I don't get it… But whatever, thanks for trying!

Shawnanator 18 years, 1 month ago

Anyone else?

Afromonkey0 16 years, 11 months ago

Alpha man, OF COURSE he ripped of Westwood Studios! How could a rts called grid alert not be a rip off? Most of the games here are clones or use ripped sprites. there's nothing wrong with immitation games.