Unit 6 Lesson 9 Bug Grab Code U6 L9

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?

Does anyone have the exemplar for Bug Grab game?

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.

Lena,

Just checking in - did what @mmathews say make sense?

Brad

They got it! :smiley:
“v” is their bug
ButtonDown checkWin

2 Likes

Do you think you could share the link to their code so we could see how it works? Sounds like a fun idea.

1 Like

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.

1 Like