• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM "exit" doesnt work for gravity?!

J

JohnZone

Guest
why? If I jump and I press the button to execute "exit" it doesnt do anything for the gravity!!

(if keyboard_check(ord("A")) exit)

why does it work for everything except for the gravity? if I press it while my character is in midair he executes that jump but he should stop in midair... why doesnt it work?!
 

Dr_Nomz

Member
Maybe because it's supposed to be written more like
Code:
if keyboard_check(ord("A")){
  exit
}
At least I recommend trying that, idk if it matters or not.

Though it might help if you detail exactly what you're trying to do, and give us the full code of what you're working with, because what you've got here seems a little vague.
 
J

JohnZone

Guest
no it doesn't work
btw. how do i write with that code thingy
 

rIKmAN

Member
btw. how do i write with that code thingy
Above the textbox where you write your text, click the 4th button from the right (Insert) and choose "code".

Alternatively manually write the [ code] and [ /code] tags (without the space) and put the text you want displayed in a code box between them.
 

FrostyCat

Redemption Seeker
why? If I jump and I press the button to execute "exit" it doesnt do anything for the gravity!!

(if keyboard_check(ord("A")) exit)

why does it work for everything except for the gravity? if I press it while my character is in midair he executes that jump but he should stop in midair... why doesnt it work?!
If you use the built-in gravity variable, you need to set it back to 0. exit will not skip that for you.

If you use a custom variable for gravity, make sure the code for incrementing vertical speed by gravity comes after the exit, not before. exit will not undo things that are already done.

Alternatively manually write the [ code] and [ /code] tags (without the space) and put the text you want displayed in a code box between them.
Can you guys please stop using that "without the space" hint for code boxes? There's a way to make [code] and [/code] tags show up in plain view. Quote this in the BB Code editor and see how.
 

rIKmAN

Member
Can you guys please stop using that "without the space" hint for code boxes? There's a way to make [code] and [/code] tags show up in plain view. Quote this in the BB Code editor and see how.
It's not so much a hint as an explicit instruction, but now I know how to do it I'll start writing them normally and wrapping them in [ plain] and [ /plain] tags (without the spaces) ;)
 
Top