How do I

In games like Mario there are those brick ledges you can jump on. For me I have a book sprite that you have to be able to jump on. How do I make it so that you can jump on top of it and that you can't jump through it.

Normally in these sort of games, Mario will try and move down unless there is something below him.

So you can test if the Mario is touching the book sprite, and if he is, don't move down.

You can do the same check when jumping up and if Mario hits the book from below, he starts falling down

so what would the coder look like?

So what would the code look like?

I don't have any code for something like this

Best way would be to search the Scratch site for platform engines and look at how other people have done it

Here is a good example https://scratch.mit.edu/projects/59580114/editor/

Nearly all Scratch code can be re-written in Snap!

I tried to add the code from that website into mine but it ended up interfering to much. Is there any other way?

There will be other ways but I've never coded a platform game so I don't know any myself

Look at this:
https://scratch.mit.edu/projects/67727504/
It's designed for Scratch but easily make-able in Snap!

I actually figured out a really easy way to do that yesterday when I was experimenting. By thank you!

I would still look at the Scratch project, though. It's really interesting and helpful.

ok. Thank you!

You can also take a look at this project by @jens: https://cloud.snap.berkeley.edu/site/project?user=jens&project=Platformer

1 Like