The game's rules are to stack as many character blocks as possible to make it as tall as possible; if the blocks are stacked too crookedly, they will slide down.
However, I don't understand why the first block must be placed in the exact center of the bottom platform. If it's stacked even slightly to the side, it will unreasonably slide down. I want to correct this error but don't know how.
2 Likes
This is a fun and silly game! I love the inclusion of PIGEONS!! ![]()
Here’s my best tower:
The error where the blocks slide off of the bottom platform happens because your code only stacks the blocks when their x-values are within 10 pixels of each other.
This works for the smaller characters (where any distances greater than 10 pixels would be too far to stack) but because the bottom platform is much wider, 10 pixels is not enough distance to cover the entire platform.
To fix this, I first made the 10-pixel distance into a variable:
That way, I could check if the character was landing on the platform, and make the distance greater in that case:
Here’s the fixed code, let me know if this works for you!
2 Likes


