Computer Science Canada help with walking restrictions |
Author: | shoobyman [ Fri Oct 13, 2006 4:37 pm ] |
Post subject: | help with walking restrictions |
The code is supposed to create walking restrictions for my character, and it does, but then my character gets stuck in the barriers that I have set up. i set it so that if colour=yellow then it is walkable but if he goes inside black (which is unwalkable) then he can't move any furthur. However, when my character goes inside black, he gets stuck! WHAT THE HELL?????? plz help prog attached |
Author: | Tony [ Fri Oct 13, 2006 5:37 pm ] |
Post subject: | |
without looking at all of that code, the most common problem is that your object moves further then where the check happens. For example, if you check for the colour one step ahead, but your unit is moving fast and travels 2 steps at a time, there's a chance to _jump_ over the barrier and get stuck |
Author: | neufelni [ Fri Oct 13, 2006 5:40 pm ] | ||
Post subject: | |||
The program is doing exactly what you programmed it to do, to get stuck when it gets into black. You need to make it so that your character can go rigth up to the black, but not actually go into the black. You do this by simply adding a bit to your whatdotcolors.
|