PDA

View Full Version : not all boundaries working



stuartRowe
August 7th, 2005, 10:14 PM
as far as I know the collision code I've written should be working, but some of the time the character isn't being stopped from moving past a boundary. In the .fla and .swf the boundarys are the borderless green rectangles, while the 4 bordered rectangles around the character's feet are his "boundaries". If someone could help me figure out why its not working I'd really appreciate it. thanks.

Enix591
August 7th, 2005, 10:48 PM
Hmm, i see your problem and cant really solve iit myself.But if it helps it looks really good, did you use the 3d tutorials on kirupa, if not you should they might solve your problem.

Aggrix
August 7th, 2005, 11:16 PM
Change all the else if's in your code to just if statements. With the else if's it will first detect a left hit and if there is one, then it will skip the others and only set the lefthit flag. This allows the character to move the other directions because the other flags aren't set (hope you understand that). You might also want to up the frame rate.

NiñoScript
August 7th, 2005, 11:54 PM
maybe it would help if u make a smaller movement with a bigger framerate, that way it wouldnt jump the yellow line, i think...

stuartRowe
August 8th, 2005, 12:19 AM
thanks to all who replied, and in such a fast manner! yeah Aggrix, that makes loads of sense, I can't beleive I didn't spot it before, and I just haven't bothered to up the frame rate yet. I was hoping to make a tutorial based on the development of this game, cause I wasn't able to find out a lot about art-based games myself, do you think there would be enough interest? Thanks again.