O'Reilly logo

Beginning Android 4 Games Development by Robert Green, Mario Zechner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required