Libgdx tutorial beginner Part 2 – Player

In this second part we will add the player and cube which will interact with the world/level we are going to create in the next part.

  • Here we have the player Bob and cube that we’re going to control
  • Yes the Map is not there, I want to focus on these 2 for now
  • Most important thing to note is that Bob and Cube are very similar, but cube is not effected by gravity
  • fetchCollidableRects will get collision tiles and trytoMove will check if there is a collison when we are moving, pretty clear actually
  • If you are familiar with java it should be clear, but if you are completely new to game programming just ask anything and I’ll explain it, will add more explanation later

7 responses to “Libgdx tutorial beginner Part 2 – Player”

  1. Bryan Herrera says:

    How did you create the pack file that’s used in loadPlayerTextures()method?

  2. Farhod says:

    I can’t do:
    spriteBatch = renderer.getSpriteBatch();
    it says it can’t resolve method with this name.
    Is my libGDX is different or something?

Leave a Reply

Your email address will not be published. Required fields are marked *