Starting the project
Create a new project and call it Scrolling Shooter
. Use the same settings as we always have: empty Activity, no layout file, no backward compatibility, for phones and tablets. When prompted, name the Activity GameActivity
.
Editing the manifest
Make the game full-screen and landscape orientation as we have done before by editing the AndroidManifest
file. Add the code just after …:name=".GameActivity"
but before the trailing >
. Here is the new code highlighted in context with the existing code:
<activity android:name=".GameActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:screenOrientation="landscape" >
The game is now locked to full screen and landscape orientation.
Code the GameActivity class
Here we will code the Activity
which is the entry point to the game. As usual, it grabs the screen size and creates an instance of the main controlling class, in this project, GameEngine
. There is...