I have been working on a small hobby project in my spare time, and have put together a very small demo of what I want to accomplish with the movement script. It includes strafe movement, forewards and backwards movement, and a view box that moves the camera at a constant rate as a function of time. However, the collision is a little funky, and I would like a little help on the matter.

What I am trying to accomplish is, allowing the player to move freely inside the view_box, but stop the player as soon as it hits the box's bounds. Also, if the player stops all movement, I want the position relative to the box to be maintained, so for instance, if the player stops in the dead centerof the box, he should remain dead center until he/she moves again. My problems are as follows...

1. If the player stops moving, the back of the box slowly closes the distance, and the player goes outside of the box. This seems to be because collision is not applied unless one of the w,a,s,d buttons are pushed (c_move)

2. There seems to be an invisible box in the center of each terrain that, for some reason blocks the player from moving foreward. You can move around it, but it needs to go .

If anyone has any ideas on how to fix either of these problems, I would be very greatful. To help you in every way possible, I have put together this small demo, for you to look at. It is an eye-sore, but it gets the point across. All code is open-source, for easy review. The demo can be found here.

A few notes:

-Terrain tileing system is not implemented.
-View box is visible for testing purposes.
-Code is not commented, because I havent gotten around to it... sorry.

Thank you again, hope the demo + code/explination is enough to get my point across

Regards,
Raddaddy


"Read not to contradict and confute, nor to find talk and discourse, but to weigh and consider." Sir Francis Bacon www.deckscapedesign.com