0

So I made a project in scratch where people have to jump to get apples. The thing is, I made a block and I want the character to not go forward when it hits that block. You can see the top block, where the apple is on. when this charcter touches it, it should not go past.

You can see the top block where the apple is on. When this character touches it, it should not go past.

UdayanS
  • 47
  • 1
  • 8

2 Answers2

1

You should check if the player is not touching the block, and only let the player move if that is true. If not, it shouldn't do anything. If you posted your code, I could answer this better, though.

Xbox One
  • 307
  • 2
  • 13
1

You could make the block a different colour, and then use an if statement to only allow the character to move forward (still back and up) if it isn't touching that color

kaiete
  • 23
  • 10
  • This method can be used if there are multiple blocks that prevent motion by making them all the same color, contrasting with my method which is sprite based, better suited for a single block. +1 – Xbox One Feb 13 '22 at 21:58