Discuss Scratch
- Discussion Forums
- » Connecting to the Physical World
- » [TUTORIAL] Advanced Physics: Connecting Your Sprite to the World!
- DanDanbingobam
-
Scratcher
26 posts
[TUTORIAL] Advanced Physics: Connecting Your Sprite to the World!
Hey everyone! DanDanbingobam here.
One of the biggest differences between a “basic” game and a “featured” game is the physics. If your character walks through walls or bounces weirdly, players lose interest.
I’ve used these techniques in my Bird Madness series to make the world feel solid, and today I’m sharing the logic with you!
1. The “Ghost Movement” Logic (Collision)
Instead of just moving and then checking if you're touching a wall, you should move one axis at a time. This prevents getting stuck in floors!
The Logic:
Change X by Velocity.
If touching ?
Change X by (Velocity * -1) <— This pushes you back out!
Set to (0)
2. Friction and Air Resistance
To make your world feel realistic, your sprite shouldn't stop instantly. It needs Friction.
Formula: Set to ((Velocity) * (0.8))
Tip: Use 0.9 for ice and 0.7 for grass to make the world feel connected to the player!
3. The “Ground Check” (Raycasting Lite)
To make jumping feel real, you need to know if the sprite is actually touching the world.
Use a variable called .
If touching , set Air Time to 0.
If NOT touching, change Air Time by 1.
The Result: You can only jump if Air Time is less than 3 (this allows for “Coyote Time,” making the game feel much fairer!).
One of the biggest differences between a “basic” game and a “featured” game is the physics. If your character walks through walls or bounces weirdly, players lose interest.
I’ve used these techniques in my Bird Madness series to make the world feel solid, and today I’m sharing the logic with you!
1. The “Ghost Movement” Logic (Collision)
Instead of just moving and then checking if you're touching a wall, you should move one axis at a time. This prevents getting stuck in floors!
The Logic:
Change X by Velocity.
If touching ?
Change X by (Velocity * -1) <— This pushes you back out!
Set to (0)
2. Friction and Air Resistance
To make your world feel realistic, your sprite shouldn't stop instantly. It needs Friction.
Formula: Set to ((Velocity) * (0.8))
Tip: Use 0.9 for ice and 0.7 for grass to make the world feel connected to the player!
3. The “Ground Check” (Raycasting Lite)
To make jumping feel real, you need to know if the sprite is actually touching the world.
Use a variable called .
If touching , set Air Time to 0.
If NOT touching, change Air Time by 1.
The Result: You can only jump if Air Time is less than 3 (this allows for “Coyote Time,” making the game feel much fairer!).
- cheddargirl
-
Scratch Team
1000+ posts
[TUTORIAL] Advanced Physics: Connecting Your Sprite to the World!
Hey, so I noticed there's quite a few thread topics from you that were guide-like and not quite relevant to the discussion board section you were posting in.
While we know that users like to create topics that are guides, the discussion board space isn't really a good place for those types of things since they don't really invite for further discussion. Perhaps instead of making a forum thread guide, better to make a project instead?
While we know that users like to create topics that are guides, the discussion board space isn't really a good place for those types of things since they don't really invite for further discussion. Perhaps instead of making a forum thread guide, better to make a project instead?

- Discussion Forums
- » Connecting to the Physical World
- » [TUTORIAL] Advanced Physics: Connecting Your Sprite to the World!
