Sign in to follow this  
manofmilk

Jumping...

Recommended Posts

Hi all, quick intro: Stuck doing a first person shooter in a program called "Jamagic" (no choice in this matter, blame my tutor) and i've got as far as trying to get the player to jump. The code i've come up with follows below - its not quite c and not pseudo code but you should be able to follow it. I've obviously only included the important bits. The game loops infinitly. While(1) //Begining of the game loop { YAmt += 2; If (Keyboard.IsKeyDown(Keyboard.RBUTTON) && !IsJumping) { IsJumping = TRUE; YAmt = -55; JumpSound.Play(); } aCamera.MoveDown(YAmt/5); } //End of the game loop Function DoWorldColl(pWorld,obj1,obj2,pPoly,pVec,collType) //Function called when collision occurs, passes all game variables { If (obj1 == aCamera) //If the object that has collided is the player (aCamera) then... { IsJumping = FALSE; //...reset the Isjumping status and... YAmt = 0; //...reset 'Gravity' } The problem I have is that the engine cannot differentiate between collisions wiht 'floors' and 'walls' so a collision with another game object or the wall resets the jump functionand allows the player to float up walls. I'm pretty much a beginer to all this so would appreciate any help you can give me. If the code needs any more explanation please ask for it. Thanks.

Share this post


Link to post
Share on other sites
If you have all those game vars, surely you can tell if a collison occurred above a player? If it did stop upward momentum, otherwise stop forward momentum.

Share this post


Link to post
Share on other sites
The thought had crossed my mind - however there simply is no help availiable for this kind of programming in Jamagic, the few tutorials that exist are little more than glorified 'hello worlds' or are strongly 2d orientated. The one book availiable I have got and found to be excellent for teaching the complete basics but all of the examples supplied with the book are full of bugs or simply don't run at all (and i've tried tham on several different pcs).
Every step i've taken has been the result of hours trawling the help files until I happen to stumble over the right function/method etc.
(I guess that wasn't really a usefull post was it... more of a warning about the lack of support (official and community) for 3d game creation with Jamagic.)
Um yes anyway...
Thank you I am looking into it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this