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 / Side Jumping

Author
Message
Yodaman Jer
User Banned
Posted: 1st Mar 2009 20:30
Hey everybody, I'm wondering how one can prevent 'Side Jumping' in DBC. What I mean is that I have a 3D sphere that can jump, but every time it collides with something solid it jumps. This means that if it goes towards a wall or another box, all I have to do is press the jump key (CTRL or spacebar) and ZOOM, I can shoot up there like there's no tomorrow. I have NO idea how I would stop this.

I can also 'hang on' to the bottom of boxes if I continue holding down the jump key. While this seems like a cool game feature, it's actually pretty annoying, especially since it keeps playing the jump sound over and over again (because I'm holding the jump key down).

So, does anyone know of a way that I could stop all of this and only allow the player to jump regularly?

Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 1st Mar 2009 20:38
Are you using normal or sliding collision?

And...I can't resist the urge!



~QJ
Yodaman Jer
User Banned
Posted: 1st Mar 2009 20:41 Edited at: 1st Mar 2009 21:20
Sliding. Here's the main program loop code:





Is there a way I can still use sliding collision and stop the side jumping? Sliding collision is the only way I can get the player to walk across the platforms...right?

Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 1st Mar 2009 21:12
Hmm, what's this?



This is in the collision part: what does it do?

~QJ
Yodaman Jer
User Banned
Posted: 1st Mar 2009 21:16
It's what enables the player to jump. I ran the program without it, and it was a DISASTER. You couldn't jump, and every time you fell it was at a rate of 5,000 MPH (or so it seemed).

So it seems that that float variable enables jumping.

Yodaman Jer
User Banned
Posted: 1st Mar 2009 21:32
I modified the code so that you can see exactly what my problem is. I removed all of the textures and texture commands so that it will run in your editor.

When you first start, move to the nearest block, press hard against it and then press CTRL to jump. You'll see what I mean by side jumping then.


Here's the code:


Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 1st Mar 2009 21:58
Okay, I tried a couple things and have come up with something!

You'll have to code it out yourself - cus I'm to lazy - but it goes like this:

First of all, you set your "if controlkey() = 1" to this:



Where objects 2-7 are flat planes that you put on the sides of the cubes that are giving you problems.

It's a little laborious, but if you can think of a better way, feel free...

~QJ
Yodaman Jer
User Banned
Posted: 1st Mar 2009 22:02
OK, so around each box I put those planes there and it will make side jumping impossible? That doesn't sound too hard...I thought that I'd have to use a function or something like that that would involve complex maths that I'm not good at. Thank God that's not the case, lol.

Thanks Quirkyjim, I'll give this a shot.

Yodaman Jer
User Banned
Posted: 1st Mar 2009 22:15
Thanks Quirkyjim, it works PERFECTLY!! I just have to adjust the plains to the right angle and side jumping will be a thing of the past!! Thank you so much!

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 1st Mar 2009 22:15
while i did find the sticky to the wally glitch lol i didn't find the other unless you mean when you jump and are against the wall when you hit the floor on the next block then it automaticly jumps again? if so then thats easy


just make a switch so for you controlkey if statement just check and see if the switch=0 if so then do whatever you need and make switch=1 and then make another if statement and if your not pressing control then the switch=0
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 1st Mar 2009 22:36
*beaming*

Glad to help, Yodaman.

All I thought was this:

Quote: "Hmm, cookies.
*breakthrough*
Hmm, time for cookies."


p.s. JK

~QJ
Yodaman Jer
User Banned
Posted: 1st Mar 2009 22:45
@ Caleb:

The second glitch was that you could literally 'hang on' to the bottom of any box that was above you. Say you had one platform that you sat on in the game and that about 15 units above you was a second platform. If you could jump high enough and you held the jump key (whether it's the spacebar or controlkey) down, you could hang on to the bottom of that above platform. While it's a cool game feature for certain games (like in Mario 64, you could hang on to the bottom of certain objects), it definitely doesn't belong in my game.

@ Quirkyjim:

Cookies are powerful! lol. Thanks again!

Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 1st Mar 2009 22:46
Kinda like holding the carrot in front of a donkey...

You should see my desk!

~QJ
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 1st Mar 2009 23:06
hahahaha so do you have a cookie in the background of your computer to act as your "carrot" lol
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 1st Mar 2009 23:11
Actually, hanging from a stick that's attached to my chair.

~QJ
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 2nd Mar 2009 00:43
hahaha good job

Login to post a reply

Server time is: 2025-06-07 23:54:49
Your offset time is: 2025-06-07 23:54:49