Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by mahgo

Hi,

I'm making an RTS game and I'm trying to implement Friendly entities not overlapping each other, whereas they can overlap enemies. How would I do this?

I've fiddled around with making the Friendly entities' collision FIXED, but they just push things (Friendlys and enemies) not only out of their way, but they bounce off each other.

1 decade ago by anthony

What do you have set for their .checkAgainst property?

http://impactjs.com/documentation/class-reference/entity#checkagainst

1 decade ago by anthony

I had to figure out something similar like this today to stop a player putting more than 1 game pieces in one board spot.

How I got around it was, for a game piece 'g' in its update():

Loop through all the other game pieces and don't update the position of 'g' if the distanceTo() from 'g' future position to any of the other pieces was 0.

1 decade ago by mahgo

Their types and checkAgainsts are ig.Entity.TYPE.A, as they have different actions which happen when they collide.

Ok I'll take that into account, thanks.
Page 1 of 1
« first « previous next › last »