Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Sprites falling thru floor
- kyeeesisscratch
-
Scratcher
9 posts
Sprites falling thru floor
Hi! I'm making a scratch game where the sprite falls through the floor if you jump off of platforms, or just straight up doesn't stand on platforms. I've watched tutorials, but they all make a new project and start from there with code I don't have. So I came here for more specific help.
https://scratch.mit.edu/projects/825424443/editor
Jump button is the space bar. Please respond, because I have 11 days to finish this.
https://scratch.mit.edu/projects/825424443/editor
Jump button is the space bar. Please respond, because I have 11 days to finish this.
- kyeeesisscratch
-
Scratcher
9 posts
Sprites falling thru floor
Also, for specifics, I have a variable called “Floor” that detects when a Sprite is touching the floor or a platform and stops the sprite from falling.
- TheCoder12365
-
Scratcher
100+ posts
Sprites falling thru floor
Did you make the project private, bc I can't seem to open it.
- _turtle64
-
Scratcher
100+ posts
Sprites falling thru floor
you need to share the project for us to view it
- NMario84
-
Scratcher
1000+ posts
Sprites falling thru floor
Typically when I make platformers I just use a ‘my block’ and run without screen refresh. Then I have the sprite repeat move 1 pixel up out if they are overlapping the ground. So something like this.
when green flag clicked
set [grav v] to (0)
forever
change [grav v] by (-0.25)
change y by (grav)
check floor
end
define check floor
repeat until <not<touching [ground v]>>
set [grav v] to (0)
change y by (1)
end
Last edited by NMario84 (Dec. 8, 2023 00:41:25)
- Discussion Forums
- » Help with Scripts
-
» Sprites falling thru floor



