Android Open Source - AmazingGame Game Map






From Project

Back to project page AmazingGame.

License

The source code is released under:

GNU General Public License

If you think the Android project AmazingGame listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package game.world;
/* ww  w  .j a  va  2  s.  c  o m*/
import com.badlogic.gdx.scenes.scene2d.Stage;

import game.generator.MapGenerator;
import game.helpers.MapHelper;
import game.objects.TileSprite;
import game.objects.Unit;

public class GameMap
{
  private MapGenerator mapGen;
  private TileSprite[][] tileMap;
  private Unit[][] units;
  private Stage stage;
  private MapHelper mapHelper;


  public GameMap(int numPlayers)
  {
    mapGen = new MapGenerator();
    tileMap = mapGen.generate(100, 100);

    units = new Unit[numPlayers][];
    for (int i = 0; i < numPlayers; i++)
    {
      units[i] = mapGen.generateUnits(i);
      PlayerManager.addNewPlayer();
    }

    mapHelper = new MapHelper(tileMap);
    System.out.println(tileMap[0][0].getCenter());
    // stage = mapGen.createActorListeners(tileMap);
  }

  public void update(float delta)
  {

  }

  public TileSprite[][] getTileMap()
  {
    return tileMap;
  }

  public Unit[][] getUnits()
  {
    return units;
  }

  public void selectTile(int x, int y)
  {
    mapHelper.selectTile(x, y);
  }


  public Stage getStage()
  {
    return stage;
  }

  public void endTurn()
  {
    PlayerManager.endTurn();
    for (Unit u : units[PlayerManager.getCurrPlayerTurn()])
    {
      u.resetAttack();
      u.resetMove();
    }
  }
}




Java Source Code List

game.IOSLauncher.java
game.MyGdxGame.java
game.android.AndroidLauncher.java
game.client.HtmlLauncher.java
game.desktop.DesktopLauncher.java
game.generator.MapGenerator.java
game.helpers.AssetLoader.java
game.helpers.Constants.java
game.helpers.MapHelper.java
game.helpers.TileClickHelper.java
game.input.MapInputHandler.java
game.objects.BlurpleBuilding.java
game.objects.BurnedMoose.java
game.objects.Grass.java
game.objects.PoopDesert.java
game.objects.River.java
game.objects.TileSprite.java
game.objects.Tree.java
game.objects.Unit.java
game.objects.Wall.java
game.objects.Water.java
game.screens.GameScreen.java
game.world.GameMap.java
game.world.GameRenderer.java
game.world.PlayerManager.java