In this video, you will create a winning condition for your game.
If the two sprites touch, then the user wins this platform game.
To program a winning condition, add another conditional statement. Click the control menuand place an "if" block inside the forever loop.
The rest of the code in this step will be up to you to design and create. Decide whatwill happen if the sprite gets to its goal. You can program your sprite to say “yayyou win!” Or do a backflip! Or even bounce around the stage! It’s up to you!
Make your CS First experience more social and fun by sharing what you created todaywith the Scratch community. Before you go, hit the “share” button and write a descriptionof your project so others on Scratch can enjoy it.
A big part of computer science is persisting through tough problems. If the first solutionyou try doesn’t work, try again.
Now it’s your turn: 1. Program an if statement for when the userwins 2. Decide how your sprite should celebratewhen it winsTry a few things for your winning condition code. Explore different blocks to see whatthey do.
Once you have a winning condition that you’re happy with, ask a friend to try your game!