Snap! project: Vote on a Bill
🗳️ Snap! Project: Proposal Voting and Movement
In this exercise, you’ll build upon your previous project and add new functionality! You'll be working with If-Else statements, arrow key controls, and global variables to create an interactive proposal voting system.
🛠️ What to Do:
-
Open the Project: Begin by opening the Snap! project where you’ll continue your work from the previous exercise:
-
Tasks:
-
Add movement: Program the 'Proposal' object to be moved using the arrow keys.
-
Trigger voting: Modify the 'Parliament' and 'Council' objects so the vote is triggered when the 'Proposal' object comes into contact with them (instead of being triggered by clicking).
-
Global variable: Store the voting decision in a global variable that can be accessed by the proposal object.
-
Space bar action: When the space bar is pressed, the proposal object should announce whether the proposal has been approved, rejected, or if no decision has been made yet.
-
🔍 Need Help?
If you're stuck or want to check your work, you can view the solution here:
Feedback
We appreciate your feedback! It helps us continuously improve our course materials.