SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

2.10 Challenge: improved gravity

There’s one other small bug in your game: gravity doesn’t pull the character sprite downwards if any part of the sprite is touching a blue platform. So even if the sprites head touches a platform, the sprite doesn’t fall! You can test this yourself: make your character climb most of the way up a ladder, and then move the character sideways beneath a platform:

screenshot

To fix the bug, you first need to give your character sprite new trousers that have a different colour (on all costumes).

screenshot

Then replace this code block:

with this code block:

To make sure you’ve fixed the bug, test the game after you’ve made these changes!

×
×

Cart