Whenever you need to switch screens (e.g., going from Main Menu -> Game), you can just call the setScreen function from your game. You can do this for any number of screens you need (e.g., MainMenuScreen, GameScreen). Thus, to have different screens, just create a new class that extends. Once a Screen has been set, it simply passes all the method calls like render() and resize() to a given screen. If you look at the logic of the Game class, you will see it has a setScreen function. Now, change it to extend Game instead, which should be in the package. It would be a class extending ApplicationListener. java file in your -core project named after your game name. The easiest way to accomplish this would be to do the following. To have a main menu when you game starts up doesn't switch the Activity, but just presents a different set of objects to be rendered to the same Activity. If you are using LibGDX, you need to forego the concept of Activities and Views, since your entire game will now just be a single Activity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |