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 Professional Discussion / Sparkys DLL - 3D Jumping problem.

Author
Message
Ramon156
14
Years of Service
User Offline
Joined: 13th Jul 2011
Location: Netherlands
Posted: 8th Dec 2012 13:17 Edited at: 8th Dec 2012 13:18
Hello again! Besides making a game with reading waypoint maps traffic lights etc. from an X file. I am currently making a different game on the side, to clear my mind a bit.

I'm using Sparkys DLL for my collision.
I have never done this before, player movement. I've always used the Sparkys DLL example and edited it to my needs.
But now I'm writing my own piece of movement code, and I need some feedback!
All is working OK, except that my player sometimes gets stuck when jumping. This happens at the very start of the game, and it happens when I walk up the pretty stair I've created.

Here is my code :



And I've attached the game.

It acts as if my collision check from the player is still inside the stair. When you press space a couple of times you'll notice it's "out" of the collision and acts normal again.

Any other feedback on the code will be accepted as well!
29 games
20
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 12th Dec 2012 22:23 Edited at: 12th Dec 2012 22:25
Hi Ramon, I think the problem with the stickiness on the stairs is because you're doing two checks for colliding, the sphere cast and then a ray cast straight down, both of which affect the player's y position and they're interfering with each other.

I also noticed that when jumping up and falling back down again, the player's y position isn't consistent. If I'm on the ground and jump up, on landing the y position is anywhere between 5.8 and 7.3. I'm not entirely sure what's causing this.

If you post your entire code I can have proper look at it.

Login to post a reply

Server time is: 2026-07-08 03:47:30
Your offset time is: 2026-07-08 03:47:30