Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Stop Climbing My 75 Degree Hills!

Author
Message
MTGiga
22
Years of Service
User Offline
Joined: 16th Jan 2003
Location: - Please Select -
Posted: 17th Jan 2003 02:42
Can anyone help me? I can stop the player from running straight up a hill, but if they turn so only the corner of the camera touches the hill, they can climb it.

My code detects the height of the current ground level, the the level of the ground you are about to move to. If it is a certian height, you are not allowed to climb. However, my climbing at a slant, that modifies the height you are climbing, therefore throwing my math off:

Picture:
http://members.tripod.com/mtgiga/pblm.htm

Look at the two blue points in each image. Do you see the height differance? That is my problem. Can anyone help? Please E-mail Me!: [email protected]
Dr DooMer
22
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 17th Jan 2003 04:18
Hmmm, I do forsee a problem with that. I also forsee a few solutions:

You could check, every frame that the player moves, what the height offset of the ground is immediately to the left, right, front and back of the player. Then, if one of them is a large offset, nudge the player a bit so they 'fall' down the slope. This method will also make sure you get the right effect if the player walks off an edge. However, you'd have to make sure that only one of the four height tests produces this nudging result, otherwise your player could plummet at twice the speed if the ground on both his front and right (for example) is steep.

Or, you could come up with something more mathematical. You could assign each square of the matrix a value within an array. This value would basically store the slope level within that matrix tile and which direction the player should fall in if he enters that square. You would then run a function or something that analyses each tile before the game begins.

Does this help?

"I am a living, thinking entity who was created in the sea of information."
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 17th Jan 2003 05:32
the latter is good as u can modify it when the ground is moved dynamically.

It also allows for a range of climbing abilities,eg: spiders can crawl over all the tile numbers while a rabbit can only traverse in low areas.

Its easy to save this way also and loads fairly quickly
depending on how big it is.

to slip back down you can apply a feature that applys a reverse force.


You could also have static boxes placed to prevent the player moving up, combinations of elements can sometimes reduce large loops.

Attreid
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 17th Jan 2003 20:50
hmm I don't speak well english and I'm not in a mood to read all thoses posts ( is this sentence correct ?? )
I made a snippet to calculate the angles of the matrix, you can try to replace the player with a calcul of the angle, but I never tried ithttp://www.darkbasicpro.com/apollo/view.php?t=3756&b=6

I'm following John, but I'm not john.
Lol, it is funnier in french

Login to post a reply

Server time is: 2025-05-11 07:58:09
Your offset time is: 2025-05-11 07:58:09