February 04, 2012, 04:09:53 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [TUTORIAL] Make marble game ball jumpable  (Read 512 times)
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« on: July 18, 2010, 08:37:12 AM »

Here is a pdf with information on how to modify the marble game files so you make the ball jumpable. I hope there is no mistakes in it because I did it at work when I had nothing to do and didn't have access to GC Wink But has worked at home so far.

Happy jumping
Logged
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #1 on: July 18, 2010, 09:50:35 AM »

thanks pixel but two mistakes

Code:
if (doJump)
        {             
            ball.AddForce( Vector(lookLeftRight, JUMP_FORCE, 0));
            ball.SetGravityEnabled( true);
        }
        doJump = false; 

"lookLeftRight" is not use in this script so replace it by 0
and " ball.SetGravityEnabled( true);" doesn't work so don't use it.

I haven't  try to change the"infinite jump effect" but it's funny, you can complete the level in 3 seconds  Grin
Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #2 on: July 18, 2010, 12:03:51 PM »

thanks for this, but with those lines it seems to work with my template, but all corrections are good Smiley I might try to do the onGround thingy later on but for now the infinite jump is quite fun as you say Smiley

There is also no death height witch is strange on such an open stage Smiley
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #3 on: July 19, 2010, 10:40:56 AM »

I am trying to modify the script so it checks weather we are on the ground or not so we can only jump once before we land.

I am able to get the script working...once, so he jumps once and then stops and can't get him to jump again.

I have marked the script with
//////////////////////////////////////////////////////////////
where I have pasted some code so perhaps someone can look at it?
Logged
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #4 on: July 19, 2010, 01:47:26 PM »

i'm looking at it

the first thing i see is your variable "floatOffGround = ball.GetCenter().y", it is useless. To know if your onGround or not  just look the distance of the raycast. if it's more than a certain value, your are in the air and you can't jump.

Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #5 on: July 19, 2010, 03:54:00 PM »

ok found, i will post the new file in a few minutes

PS : it's not perfect, need more work  Undecided
« Last Edit: July 19, 2010, 04:07:44 PM by LutinMalefique » Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #6 on: July 19, 2010, 04:18:02 PM »

now the ball can jump more than once but also when she is in the air Angry
so need more work (raycast problem)


PS:there is indeed a raycast problem, from the moment the ball moves, it is no longer active.
Do a Ctrl+X and Ctrl+C in the game, you can see the raycast, if you don't move the ball, the raycast strikes the ground but when she moves, the ray is not in contact with the ground.
« Last Edit: July 19, 2010, 04:37:36 PM by LutinMalefique » Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #7 on: July 19, 2010, 05:32:32 PM »

ok i stop here for today, my script does not work but i have a clue, you use CollisionCallback to check if the ball strikes the ground (name your ground object "ground" for exemple and if the ball is in contact with it, you can jump)

good luck
Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #8 on: July 19, 2010, 07:11:32 PM »

thanks for all the help, it is 1am here now so need to sleep but will look at it. The code I have taken is from the network_character.gsl and the player can jump, not good but can jump, so should be possible with same codes like ball.getcenter etc.

Strange Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!