Does your gravity look like this?
Don’t you wish it could look like this without the use of 2D Physics blocks?
Well, I can show you how! First, you need to select a sprite!
I’ll choose a white squircle.
Then you need a Level sprite! I will just use a square. Alright, let’s get to coding! First we need a
when green flag clicked
block!
Now we need a forever loop! It should look something like this:
We should make a Gravity variable, and don’t forget to start off with Gravity being 0!
Here’s what I did:
Now don’t forget to add collision!
This didn’t quite work. Let’s fix that!
Perfect! Now we need a key to press to start it! I’ll use Space Bar.
Uh oh! The player can jump indefinitely! Let’s fix that!
Good job! You just made customizable Gravity!