Computer Science Canada whatdotcolour collision |
Author: | shoobyman [ Sat Nov 25, 2006 3:07 pm ] | ||
Post subject: | whatdotcolour collision | ||
I am making an RTS and i am trying to make collision for the builder unit. If he moves into an area that is not colour 27 (grey), he should not be able to move. but the problem is that when he moves diagonally he can move into non grey parts a little. This really messes things up because he can move ontop of other builders and then you lose control of him ![]() |
Author: | Windsurfer [ Sat Nov 25, 2006 6:42 pm ] |
Post subject: | |
I find that the easiest thing to do for full-stop collision is to make a "following" variable that you use for when it collides. Basically, you set the variable to the location of the object (or builder) then get the builder (or object) to move as it would normally. If it is overlapping grey, simply reposition the object to the "following" variable, as it will be at it's last position. Simple! |