6 Mayıs 2015 Çarşamba

android apk Tutorial (Show Us The Good Series) - Jungle Game Menu

android apk Tutorial (Show Us The Good Series) - Jungle Game Menu android game , android apk Tutorial (Show Us The Good Series) - Jungle Game Menu android free download , android apk Tutorial (Show Us The Good Series) - Jungle Game Menu mobile game android apk Tutorial (Show Us The Good Series) - Jungle Game Menu android free download

You have completed your awesome game (2D/3D or anything else) in LibGDX in your way. Now its time to polish it with interactive stuff like a charming game menu. Lets see how can we do that in only 1 day.




















FIRST THINGS FIRST

You should know about Mtx  which is built over LibGDX Scene2D (please complete the free tutorial series 1,2,3,4), because I will not talk about every detail or Mtx related-classes, I will explain the general idea.


ACTORS BECOMES BUTTONS

What I love about LibGDX Scene2D is the actors, they can be anything you can image. In my case I took my SmartModel (which extends AbstractActor) and make it button, "JungleGameButton" class is my button  model.


ALL INTERACTIVNESS IN SAME SCREEN

I have only one screen in this tutorial which is responsible for splash/loading, game menu and instructions. I did not create screens for each one of them.

This way, it is much more impressive, animations, effects, transitions, movements and the composition is much better.

The life-cycle is like:
  1. First show splash/loading screen and start background effects like green balloons at the same time
  2. Send menu elements in
  3. Swipe for instructions and send menu elements away, and get instructions
  4. Swipe for menu and send instructions away, and get menu












































SCREEN STRUCTURE

All elements (buttons, flowers, gamename, etc) are in the Screen class, so the screen is like little fields container/database and main manager.































Screen is the main manager, it is the king who controls other managers, so the real workers are


JungleMainMenuScreenButtons jungleMainMenuScreenButtons;
Set up menu buttons, send them in and away with animations and effects 

JungleMainMenuScreenEnvironment jungleMainMenuScreenEnvironment;
 Set up menu background and name (balloons, gamename, flower), and send them in and away

JungleMainMenuScreenInstructions jungleMainMenuScreenInstructions;

Set up instructions and send them in and away 







MANAGEMENT

Screen will manage all the things it will check if splash is completed or not (I made a fake splash, normally you may use assetmanager of LibGDX)























When the splash is completed, screen will command to "jungleMainMenuScreenButtons" to send main menu buttons, social buttons and swipe buttons. Screen will also command to "jungleMainMenuScreenEnvironment" to send the game name in

Screen is also manages the swipes if you swipe UP and DOWN, Screen will command to "jungleMainMenuScreenButtons" and "jungleMainMenuScreenEnvironment" for sending all the necessary stuff in or away. Please check the "setUpSwipeListener()" method for more detail on this.

So, I beileve you understood the fundementals of interactive menus/screen. One manager manages all other small manager, command them to do things necesssary.





OUR LITTLE MANAGERS (REAL WORKERS)

JungleMainMenuScreenButtons jungleMainMenuScreenButtons;
Set up menu buttons, send them in and away with animations and effects 

JungleMainMenuScreenEnvironment jungleMainMenuScreenEnvironment;
 Set up menu background and name (balloons, gamename, flower), and send them in and away

JungleMainMenuScreenInstructions jungleMainMenuScreenInstructions;

Set up instructions and send them in and away



All methods in this classes have parameter for the screen, so they can easily reach the element in screen class such as buttons, flowers and etc...

Method structure
  • setUp.....(Screen screen) - set up something, construct it, set position and hide if necessary while waiting splash, set origin, add to stage and etc... This also where to specifiy buttons to do something by using ActorGestureListeners (touchUp/touchDown)
  • sendIn.....(Screen screen) - send something in to screen, it may also scale things or fade in things by using animations or screen, so this is the place does all that cool transitions, animations
  • sendAway.....(Screen screen) - exact opposite of sendIn.....()


I wont explain what are in the methods, it is very easy and upto your imagination/composition. By using Effect Creator, I made some cool animations, transitions, in some places I used Actions directly instead of EffectCreator.

With this tutorial and the source code, now you can easily do many things for your game. You can use the code anyway you want and also graphics I made for this tutorial are free to use.


0 yorum:

Yorum Gönder