My students would like to design games like the Bug Grab.
Would they be setting it up like Lesson 8’s Emoji Race, but instead of
[onBoardEvent ButtonL press]
and [OnBoardEvent ButtonR press]
would the
[movePlayer “red”]
[movePlayer “blue”]
code be the “bug” instead of “red” or “blue” or ? ??
Then in the
[function movePlayer player]
how do we make the ButtonL press go left and ButtonR press go right?
And how would the onBoard event know the difference?
Use the x property of the bug.
The app is very similar to the emoji race with a few subtle differences.
The players are still using the buttonL and buttonR to interact with the game. But instead of moving the emojis down, we use the x property of the bug to move it left or right.
If buttonL is pressed move the bug to the left
If buttonR is pressed move the bug to the right.
The code is a mess right now. They need to clean the game up still, but the game screen code is working and switches to the win screen with the correct winner announced.