/libgdx

Primary LanguageJava

You can fork your repository here;

screenshot

Description

Create a libGDX project called Minicraft. Then download minicraft-assets.zip and put its contents in core/assets. Write the necessary code to make the player walk around. Use the following code to load the four player tiles in the create method:

Texture tiles = new Texture("tiles.png");
TextureRegion[][] grid = TextureRegion.split(tiles, 16, 16);
TextureRegion down = grid[6][0];
TextureRegion up = grid[6][1];
TextureRegion right = grid[6][3];
TextureRegion left = new TextureRegion(right);
left.flip(true, false);

Requirements

  • Make the player move via the arrow keys.
  • Make the game draw the correct sprite (down, up, left, right) based on which direction you are going.
  • When the player is walking, make it go faster while the space bar is held.
  • When the player walks past an edge of the screen, make it appear at the opposite edge. For example, if it walks off the right edge of the screen, it should appear on the left edge.
  • Optional:
    • Animate the player's movement. When moving up or down, you can just flipping the tile horizontally. When moving left or right, you can switch between the standing and running tiles.
    • Bring in the zombie tiles to draw a bad guy that walks around randomly.
    • Draw a green background, then bring in the tree tile and draw it randomly in the background.
    • Extra Hard: Setup the scene for your player using the included TMX file.