Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How To Make Enemies You Can Jump On?
- UnfrostedTart
-
11 posts
How To Make Enemies You Can Jump On?
I'm making a simple platformer game, and I need help making enemies you can jump on, but you can also be damaged by. Think of the enemies from the Mario games for example. I'll be grateful for any help!
- scratch978654
-
100+ posts
How To Make Enemies You Can Jump On?
You can create an enemy that's white on top and black at the bottom. Then check if you're touching black(you get damaged) or touching white(enemy dead) make sure you're touching the sprite if there are other white/black sprites in your game.
- UnfrostedTart
-
11 posts
How To Make Enemies You Can Jump On?
For some reason, the code ignores the sprite
Thanks for trying though.

- SpideyPlaysMC
-
500+ posts
How To Make Enemies You Can Jump On?
Make a “bottom sensor” sprite. It should be a small black rectangle. It should follow the player using this:
Then make the enemy sense if it is touching the bottom sensor:
Last edited by SpideyPlaysMC (May 18, 2020 19:11:08)
- maestrogeicho
-
98 posts
How To Make Enemies You Can Jump On?
This is a more advanced method that is more efficient than a sensor sprite. I assumed a few things, such as the enemy being a clone.
When I start as a clone
Forever(
If <touching player> and <player y position is more than my y position> and <abs( my x position- player x position) is less than (width of enemy):
delete this clone/ take damage
)
Sorry I didn't use actual scratch blocks, they're almost impossible to use on my computer
When I start as a clone
Forever(
If <touching player> and <player y position is more than my y position> and <abs( my x position- player x position) is less than (width of enemy):
delete this clone/ take damage
)
Sorry I didn't use actual scratch blocks, they're almost impossible to use on my computer
- UnfrostedTart
-
11 posts
How To Make Enemies You Can Jump On?
I made the game public, so you can help by commenting on it!
https://scratch.mit.edu/projects/395920958/
https://scratch.mit.edu/projects/395920958/
- SpideyPlaysMC
-
500+ posts
How To Make Enemies You Can Jump On?
Yes, that is more efficent and compact that way. This is a more advanced method that is more efficient than a sensor sprite. I assumed a few things, such as the enemy being a clone.
When I start as a clone
Forever(
If <touching player> and <player y position is more than my y position> and <abs( my x position- player x position) is less than (width of enemy):
delete this clone/ take damage
)
Sorry I didn't use actual scratch blocks, they're almost impossible to use on my computer
- UnfrostedTart
-
11 posts
How To Make Enemies You Can Jump On?
The code isn't responding to my game, though. Seriously, the code is ignoring everything I put in.
Last edited by UnfrostedTart (May 19, 2020 13:16:08)
- Discussion Forums
- » Help with Scripts
-
» How To Make Enemies You Can Jump On?