Build the Space Shooter Game
Create a 2-D arcade game for shooting targets --in this case, flying iPhones. You'll learn how to animate objects with Clock Timer event and react to events like two objects colliding
These lessons come from USF Professor David Wolber's AppInventor.org - A great resource for learning App Inventor.
They are copied here simply because YouTube is blocked at our school.
Drag two ImageSprites into the Canvas and set their Image property to picture files. Then add a Clock component and move the bullet on the Timer event.
Watch the video and follow along. Any code/settings can be also found below the video.
> Go to http://beta.appinventor.mit.edu/ to begin.
In this step you will need two files (also available on S:\Shared\Students\Tech Ed\App Inventor\Lessons\Shooter). Click each link to save the file to your desktop.
spacecraft.png iphone.png
On the Shooter.Touched, enable the Clock.TimerEnabled
Watch the video and follow along. Any code/settings can be also found below the video.
Set the visibility of bullet so it appears on Shooter.Touched and disappears when hits top edge.
Watch the video and follow along. Any code/settings can be also found below the video.
Add two buttons and move the shooter appropriately when each is clicked.
Watch the video and follow along. Any code/settings can be also found below the video.
Drag in another ImageSprite and set up a label for score. On the CollidedWith event, add a point
Watch the video and follow along. Any code/settings can be also found below the video.
Code the Target.EdgeReached event and make the bullet invisible as soon as it hits target.
Watch the video and follow along. Any code/settings can be also found below the video.
For more information on moving a sprite by tilting your device, see this video.