how to make an actor jump without gravity

TailGamesTailGames Member Posts: 76
edited August 2012 in Working with GS (Mac)
now i have checked the forums before and they all seem to have unclear and confused gamesaladers and im hoping not to be the next one, so im working on my new game and it involves a actor that jumps and i have no idea how to do that and i know the talented people here on the forums know how to and i apreciate any help honestly :)

Comments

  • Pennez-GamesPennez-Games Member Posts: 107
    edited August 2012
    ok first off you'll need 3 actors, a jump actor (so when you click it you'r actor will jump)
    a main actor (that jumps)
    and a floor,

    first off go into the floor actor, go to physics and uncheck movable and change restitution to 0


    now create a game attribute called "jump"


    now go into your jump actor and create a rule (make sure its when all the following are happening),
    if touched is pressed and game.jump = 1
    do --> change attribute game.jump to 1
    otherwise--> Rule, when touch is released change attribute game.jump to 0


    Now go into your main actor, go into physics and change restitution to 0, and check fixed rotation,

    now put an accelerate behavior in the main actor, make it face 270 degrees down, at a speed of about 500 to 700.
    and also put a collide behavior in the main actor, and make it say collide with the actor floor.

    now create a rule in the main actor;
    if game.jump = 1
    do--> timer for 0.3 seconds
    accelerate up 90 degrees at a speed of 10000 (relative to scene)

    change attribute game.jump to 0 (not inside the timer behavior)

    this should work, if it doesnt let me know


  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
  • TailGamesTailGames Member Posts: 76
    pennez i got it to work perfectly :) but i have one slight problem and it is when i jump and press again it keeps going up depending on how many times
Sign In or Register to comment.