problem with moving and jump with gravity at same time

prajpraj Member Posts: 68
edited July 2012 in Working with GS (Mac)
and also my character does not move down when in air while clicking right/left. if i dont click anything, it is perfect but that defeats the purpose of this like jumping over enemy. meaning if i click up button then left or right button then the character will move in same line. if i let go then it will fall. Also when i dowble click up, it will go higher each time.

Answers

  • HC_DKHC_DK Member Posts: 92
    edited July 2012
    Look at this file: http://dl.dropbox.com/u/12878764/Movement.zip

    Gravity is set to 0 in both X and Y.

    To control the player Motion.Linear.Velocity is used both for LEFT, RIGHT and JUMP.

    The Accelerator behaviour is to "push" down the player.

    The player can be moved in the air.

    Limited to only make a "single" JUMP. When touching "Ground" you can JUMP again.

    HC
  • prajpraj Member Posts: 68
    ok but hw to do for iphone game as i am not using keyboard. when i change to attributes there is no option to say when not pressed... u gt it?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited July 2012
    Don't use gravity. Use an accelerate behavior to mimic gravity. How you want something to be in a normal state you put it in the otherwise section of the rule in essence that is the not. Here is a video on jump games.



  • HC_DKHC_DK Member Posts: 92
    edited July 2012
    @praj: Why make a new post with the same question you asked in this post? (http://forums.gamesalad.com/discussion/46259/need-help-with-keyboard-to-touch#latest)

    To answer your question, make 3 boolean attributes "Go Right", "Go Left" & "Jump".
    Make 3 actors, one for each direction.

    Add a RULE - When Touch is PRESSED:
    Change Attribute: Go Right to TRUE
    OTHERWISE:
    Change Attribute: Go Right to FALSE

    Do this for all 3 directions and change from KEY PRESSES in the PLAYER-actor to the direction attribute.
Sign In or Register to comment.