3d running and jumping code almost finished

Blitz3D Forums/Blitz3D Beginners Area/3d running and jumping code almost finished

fox95871(Posted 2009) [#1]
I managed to put together a pretty good walking jump, then I got it to work in 8 directions, then I got it to have a fixed path so you can't move unrealistically in midair. But now I'm stuck on getting all that to work on both walking and running jumps. Crazy stuff happens when you try to do that!



I really tried this time to do as much of the work as I could before posting, but now I don't know what to do. Please help if you can. I thought I'd never get around to this part of my engine, and now it's almost done!


GIB3D(Posted 2009) [#2]
Hey I'll try to help you with this. I have to change the code that I have so it's all one file but hey, RossC helped me with jump code, so I'll help you. The jumping code I have came from RossC and it's pretty simple. Just wait a lil bit and I'll smack it up on here soon.

Hehe it's gettin me all gitty tryin to figure out which project I should extract the jumping code from.

Edit: Ok here it is, it didn't take long. I tried making a sort of FPS engine which didn't go very far, but I have jumping! Just look at the UpdatePlayers function and try to understand how the status is set up, copy it all if you want to.



Oh by the way I saw this error in your code

Function JumpControl()
If runstate="off" WalkingJump()
If runstate="om"  RunningJump()
End Function


Shouldn't it be "on" not "om"?


WERDNA(Posted 2009) [#3]
Shouldn't it be "on" not "om"?


Its always the dumb stuff in programming that gets you.
If I ever have a serious problem, I look VERY carefully over
all sections of code that are causing the error to make sure
that I didn't misspell a variable.
About 50% of the time I did :D


GIB3D(Posted 2009) [#4]
I often make really retarded mistakes too. BUT I don't look for them like you do. Depending on the situation, I see what's going on with the variable or what ever is causing the problem and then backtrack sort of. Sometimes I use DebugLog to find certain problems, it's really helpful.


fox95871(Posted 2009) [#5]
Fixing the om should help, thanks Werdna. Gia, looking forward to trying what you did as always.


fox95871(Posted 2009) [#6]
Oh, Gia noticed the om. Anyway, Gia, do you think you could work your magic on my actual code? I tried the one you put up and that's not really what I want. Mine's like one step away anyway, I just don't know what that step is. I fixed the om, but as you can see... yeah, not exactly desirable results on the running jump. I'm not looking for flight.

I will of course continue to try to fix this myself, but I thought I'd ask you since there are quite a few places in my engine now that say ;gias code


GIB3D(Posted 2009) [#7]
I might try at some point, but not at the moment.