Advertisement

When You Model A World, How Does The Player Stay On The Ground, Walk Over Steps?

Started by April 16, 2004 08:31 PM
1 comment, last by ps2hacker 20 years, 7 months ago
When making a model, how can you get the player to walk over certain things like steps, etc.. ?
~ Developing the futures games, in yesterday's time ~
Easiest way is to change the player''s Y position relative to the terrain''s height.

- CheeseMonger
- CheeseMonger
Advertisement
This is really a programming question, not a visual arts question.

Getting the player to stay on the ground is as simple as applying gravity, causing him to fall downward, then checking for collisions with the ground surface, or any surface that he can walk upon, and halting his fall upon such a collision. To get him to walk up stairs or ramps, calculate the new position as if he were walking straight forward, then translate this new position vertically by some maximum STEP_UP value. At this new stepped-up position, check for collision. If the player will collide with an object at this location, then it is too high for him to step up on. If there is no collision, move the player to the new location, then drop him down until he touches the surface.

It''s not really as simple as that, but that''s the basic idea.

Golem
Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller

This topic is closed to new replies.

Advertisement