Create a variable named yVelocity. Add this script to your program:
when gf clicked forever if < key [up arrow v] pressed? > set [yVelocity v] to [4] // choose a value for the height of the jump wait until <not<key [up arrow v] pressed?>> end end when gf clicked forever change y by (yVelocity) change [yVelocity v] by (-0.3) // choose a value for the strength of gravity if <touching [ground v]?> change y by ((-1) * (yVelocity)) set [yVelocity v] to [0] end end
Last edited by amcerbu (2012-09-02 23:21:11)
Offline
amcerbu wrote:
Create a variable named yVelocity. Add this script to your program:
when gf clicked forever if << key [up arrow v] pressed? > and <touching [ground v]?>> set [yVelocity v] to [4] // choose a value for the height of the jump wait until <not<key [up arrow v] pressed?>> end when gf clicked forever change y by (yVelocity) change [yVelocity v] by (-0.3) // choose a value for the strength of gravity if <touching [ground v]?> change y by ((-1) * (yVelocity)) set [yVelocity v] to [0] end
Added a conditional to prevent a glitch. I also fixed your forever loops.
Last edited by ErnieParke (2012-09-02 23:25:04)
Offline
hola
estaba haciendo un juego y cuando lo he terminado y lo he revisado al cambiar de personaje se me cambiaba aleatoriamente.
AYUDADMEEEEE!!!!!
Offline
martajudoka wrote:
hola
estaba haciendo un juego y cuando lo he terminado y lo he revisado al cambiar de personaje se me cambiaba aleatoriamente.
AYUDADMEEEEE!!!!!
...?
This is the translated version from Google Translate:
Hello, I was making a game and when I'm done and have discussed the change of character is randomly changed me. [removed as it is some unknown text.]!!
Offline
Offline
jontmy00 wrote:
martajudoka wrote:
hola
estaba haciendo un juego y cuando lo he terminado y lo he revisado al cambiar de personaje se me cambiaba aleatoriamente.
AYUDADMEEEEE!!!!!...?
This is the translated version from Google Translate:
Hello, I was making a game and when I'm done and have discussed the change of character is randomly changed me. [removed as it is some unknown text.]!!
That random text actually means "Help me!!!"
Last edited by ErnieParke (2012-09-03 08:43:47)
Offline
ErnieParke wrote:
jontmy00 wrote:
martajudoka wrote:
hola
estaba haciendo un juego y cuando lo he terminado y lo he revisado al cambiar de personaje se me cambiaba aleatoriamente.
AYUDADMEEEEE!!!!!...?
This is the translated version from Google Translate:
Hello, I was making a game and when I'm done and have discussed the change of character is randomly changed me. [removed as it is some unknown text.]!!That random text actually means "Help me!!!"
Oh. Anyway, (s)he should have posted it in the Language forums.
Offline
martajudoka wrote:
hola
estaba haciendo un juego y cuando lo he terminado y lo he revisado al cambiar de personaje se me cambiaba aleatoriamente.
AYUDADMEEEEE!!!!!
Translation: Hello, I was making a game and when I finished I discovered that the character randomly changed. Help me!
(I hope I'm correct)
Offline