Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Help with something simple I bet.

    Beginners
    4
    4
    195
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • poof92
      poof92 last edited by

      I have no clue how to make gravity what I was doing was using playerS.y += 5 which acts as the downward force but then when I make a jump with a I can just keep jumping I use if c.a then playerS.y -=20 endif that's my jump code how do I tell it to stop jumping if not on the ground?

      waldron 1 Reply Last reply Reply Quote 0
      • J
        JonnyLaw F last edited by

        so this might be kinda difficult for me to explain but here i go,
        so you already have playerX and playerY positions i assume. so what you need next is a velocity variable. next you need a boolean variable (true or false) to say if the player is on the ground or not. if the player is on the ground, then the boolean variable would be true resetting the velocity to 0. however, if the boolean variable is false, then each loop, the velocity has lets say a gravity force of 1 added to it. the velocity variable is the one that controls how high the player jumps. when the player jumps, you add a negative number to the velocity.

        i hope that makes sense as im horrible at explaining things. if not, im sure someone else can explain it better

        1 Reply Last reply Reply Quote 0
        • waldron
          waldron F @poof92 last edited by

          @poof92 use the tutorial in the help section, you need an oldstate for the button so it resets when you release it. hope this helps

          1 Reply Last reply Reply Quote 0
          • pianofire
            pianofire Fuze Team last edited by

            The theme of the first Game Jam was "Jump". There must be something in here that can help!

            https://fuzearena.com/forum/topic/751/fuze-game-jam-1-entry-list

            1 Reply Last reply Reply Quote 0
            • First post
              Last post