• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Space RTS Collision Discussion

Hello,

I'm working on a space rts kinda game and having difficulty about implementing a collision system.

So the ships move towards the pointer but when there is a ship on top of the pointer, the other ships start going ahead then back and repeating that. Basicly, if they don't touch the x and y ot the pointer, they don't get to the idle state.

and another thing, what should I do when the ships hit each other? I mean what should happen when they hit each other. Because I don't want them to stack up on each other.
ek1.png
 
Last edited:

NightFrost

Member
When I create move-to-point logic, I usually do it like:
Code:
// PSEUDOCODE
if(distance to target point > movement speed){
    move towards target point
} else {
    set location to target point
    switch to idle state
}
Ship stacking is a more complicated subject, and one way to avoid it is to use Steering Behaviors, specifically the flocking subset (alignment, cohesion, separation).
 
Top