Hi, I am building a tower defence like game, and trying to keep it simple I have not used (yet) any kind of collision detection except collidesWith - the simplest collision detection function for gideros.
my enemy units move toward waypoints placed manually at the corner of the streets on a tilemap: the waypoints have id numbers and some property, and a simple AI chooses where the unit should go next.
Everything is fine, but i tried using bump to avoid units overlapping and it looks better, however I had to give up because I have different speeds between units, and each unit could be "frozen" or "slowed" for a certain amount of time, blocking the other units on the same path (they move on a specific axis only, and it is the same as the waypoints - which are axis aligned between them since they are built on purpose along straight lines).
To decrease units speed I skip some frames in the move() function of the unit, this way I can move units slower than 1 px/frame.
The issue is that above a certain number of units stuck together, the spawning others are moved on the other side of the queue (after
the "frozen unit" - in the direction where it was going) but they still think they have to reach a waypoint which is placed well before their current position (and they should do this, because there may be different paths to take). They are already bumping with the frozen one - which could also be unfrozen right now but it won't move because the others are pulling in the opposite direction to reach the previous waypoint... I don't know if I explained the issue well.. let me know
However, I was wondering if it could be possible to filter collisions between units with different speeds (my frame skip feature is bound to a speed
property so I can check if speed>speed) in some way that the faster unit could overlap with the slower one and get through it without issues. The best thing would be that while overlapping it moves by some pixel aside.. but I am still thinking on how to do this: it should not be cpu killing.
Does anyone had the same problem? How did you solve it?