MrNomGame: The Main Activity

Our application needs a main entry point, also known as the default Activity on Android. We will call this default ActivityMrNomGame and let it derive from AndroidGame, the class we implemented in Chapter 5 to run our game. It will be responsible for creating and running our first screen later on. Listing 6–1 shows you our MrNomGame class.

Listing 6–1.; Our Main Activity/Game Hybrid

package com.badlogic.androidgames.mrnom; import com.badlogic.androidgames.framework.Screen; import com.badlogic.androidgames.framework.impl.AndroidGame; public class MrNomGame extends AndroidGame {     @Override     public Screen getStartScreen() {         return new LoadingScreen(this);     } }

All we need to do is ...

Get Beginning Android 4 Games Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.