Tilting game from last week

Last week with App Inventor we made a simple game that used the orientation sensors. By tilting the phone we could move a ball around the screen. That developed into a basic game where we had to roll the ball to catch a target. If you didn’t catch the ball in three seconds, the target jumped and you lost a life.

There are still a few things missing, in particular that when your lives reach zero the game doesn’t end. Another possibility is that the three seconds delay should reduce slightly as time goes on, making the game harder. See if you can add these or anything else you think of!

Tilting game screenshot
Tilting game screenshot

You can download the game here. Extract the file “Tilting.aia” from the zip file and you can import that into your AppInventor account. Note that I’ve slightly tidied up the screen layout at the start. I also moved the code for jumping the target into a procedure; generally when you have code to do the same thing more than once you move it into a block by itself and you can call it from anywhere.