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. MrNomGame.java; 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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.