Libgdx tutorial beginner Part 1 – Setup

This is a complete rewrite of my previous tutorial, it needed an update so I decided to redo it. Instead of using super koalio as an example I will be using cuboc. We will see how to create the cuboc game step by step. Now go create a new project and lets start.

  • The first class we see is DesktopLauncher, we can adjust some configurations for the desktop version here. Like setting the width and height of the window
  • Platformer is like a controller which will help us switch between screens and we need it to start our game
  • AbstractScreen represents the other 3 classes MainMenu, Intro and Game Screen. Implementing this interface we can do different things with each screen and is easy to manage. It really helps when implementing for mobile because you will want to do different things on each screen when the back button is pressed for example. also notice that there is a reference to Game instance to switch Scenes.
  • Okay, after the game loads we will be in the MainMenu, the render loop will start rendering the image title.png using a sprite batch.
  • The image will get stretched, honestly wasn’t expecting that got used to cocos too much, but the doc for draw(TextureRegion, x, y) says it will draw it having the width and height of the region. I guess region is the screen size in this case. Will look into this later
  • Time field is there to wait a second before we start listening for input events, if you click you will get the intro screen and then to the game screen which will be blank right now
  • Get the asset files from here cuboc

Why this game? Well I enjoyed the web version and would like to see more levels for it, I would play the s@#% out of it on mobile, rather than paid platformers which all look like candy crush and the free ones that have awful controls. After this tutorial is finished I’m planning on to add a tutorial how to create levels and maybe more features for this game.


  • George

    Awesome job, I really like your blog. If you want you can check out my game which i’ve just released. It’s using libGDX https://play.google.com/store/apps/details?id=com.blackfishgames.bouncywheel

  • Eli

    Thanks for this post. I am looking forward to this tutorial. The link to the .zip file for the assets gives me “Page not found” Could you please put it back up? Thanks!

    • metin

      Hi
      I re-uploaded the assets, have fun.

      • Eli

        Wow thanks for the quick response!

  • Hi,

    I am working on this game. Can you please tell me Where I can learn to make more levels of this game? I just want to know how can I make main game screen?

    Thanks.

Recent Posts

Recent Comments

Categories