- Open the linked project in a web browser
- Press play.
Expected: Bear is shown bouncing on a trampoline
Actual: The text “yeet” is still bouncing
How to reproduce code like I did in this project
- Create a non-empty text object
- Set image on first frame of game starts
- Wrap that set image in a repeat loop
Here’s how I think it happens:
- Setting image on the first frame causes the correct image type to be stored (i.e. Bear)
- Text is rendered on second frame, even if the object is no longer text
- The canvas is now showing text even though Bear is the stored object type
- Since the image type matches the one inside of set image, the block does nothing.
Workaround: wait a short amount before setting image type, or use empty text objects or shapes.