This site requires JavaScript, please enable it in your browser!
Greenfoot back
AniSusi
AniSusi wrote ...

2019/4/7

Gravity?

AniSusi AniSusi

2019/4/7

#
Hello, I am new here and a total beginner and I was wondering how I could code gravity. I've tried some things I found on the internet but either they didn't work for me or were too complicated. I'd really appreciate some help. Also, please note that I'm using stride.
Super_Hippo Super_Hippo

2019/4/8

#
I am not exactly sure how Stride works. But usually, you can apply gravity like this: You have a vertical speed variable. When you jump, you set this variable to some negative value (character will move up). Each act cycle, you increase the variable by a constant. This variable becomes 0 when the character is on ground / on some platform / some place where it cannot fall down.
AniSusi AniSusi

2019/4/8

#
Thank you! I really appreciate your help! Hopefully this will work now
You need to login to post a reply.