Hi Damien,

Ummm..I'm not sure about that.  I don't know how your move function
actually works. I know my movement functions would require the
player's angle, AKA the direction the player is facing, his/her speed,
plus the x, y, and z position and calculate a vector along that
direction to find out where the player's next step will be. For that
reason I wrote separate functions to move correctly.

What I'm saying is that my movement functions don't simply add or
subtract 1 to the x/y/z axes. They use trig based calculations to
determine where the player's next step will be given the player's
current angle, velocity, and position in 3d space. So I'm not quite
sure how your movement function works and if it would really apply to
a 3d fps engine or not.

On 2/1/11, Damien Pendleton <dam...@x-sight-interactive.net> wrote:

> Hi Thomas,
> You can do a more generic function for player movement. For example, I use
> the following function in my player class:
> bool move(int relative_x, int relative_y, bool running, bool jumping)
> So for my player to walk sidewards one step to the right I write:
> you.move(1, 0, false, false)
> For my player to jump backwards I write:
> you.move(0,-1,false,true)
> The move function takes care of all boundaries and timer actions and returns
> true if my player moved and false if not. It's a good way of doing it in my
> opinion instead of having different functions for sidescrollers and 3d, etc.
> As long as I define my x and y boundaries I don't have a problem. If I ever
> knew how to make a turn function and simulate it in audio I would only have
> one turn function for both directions probably.
> So instead of fifteen movement functions, I would only have two.
> Everyone has their own development preferences, but I do think that would
> boost performance a little.
> If you have any comments about it I'm always interested.
> Regards,
> Damien.

Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
All messages are archived and can be searched and read at
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to