Hi John, That is the basic concept. You might have a function called WalkForward() that updates and moves the player's position, and another function called CheckCollisions() that returns true or false depending on if the player can move in that direction or not. If the function returns true the player can move, and you go ahead and update the player's position if false you will probably play a sound to indicate he/she ran into a wall, door, etc.
Cheers! On 8/17/13, john <[email protected]> wrote: > I know it's been a while since this thread has been active, but > I'm going through my old emails, and was wondering if I could get > some more clarification on this subject. The way I'm > understanding this, you would build two functions: one for > collision detection and one for movement. The movement would run > every time through the game loop, and would call the collision > detection from within itself. The movement function would change > the player's position, call the collision detection function, and > if that returns safe, update the game world. Does this sound > somewhat correct? > > Thanks, > John. > --- Gamers mailing list __ [email protected] If you want to leave the list, send E-mail to [email protected]. You can make changes or update your subscription via the web, at http://audyssey.org/mailman/listinfo/gamers_audyssey.org. All messages are archived and can be searched and read at http://www.mail-archive.com/[email protected]. If you have any questions or concerns regarding the management of the list, please send E-mail to [email protected].
