コード例 #1
0
 // Utility Methods
 public void configureThings() {
   this.things.add(
       GameObjectFactory.getInstance().createBlock("/block_grass_1.png", 1, 1, 40, 40));
   this.things.add(GameObjectFactory.getInstance().createBlock("/block_mud_1.png", 1, 1, 40, 40));
   this.things.add(
       GameObjectFactory.getInstance().createBlock("/block_qmark_1.png", 1, 1, 40, 40));
 }
コード例 #2
0
 public void configureEntities() {
   Entity entity;
   this.entities.add(
       GameObjectFactory.getInstance().createPlayer("/spritesheet_1_player.png", 1, 1, 40, 40));
   entity = GameObjectFactory.getInstance().createEnemy("/spritesheet_1_enemy.png", 1, 1, 40, 40);
   entity.setSpeed(2f);
   this.entities.add(entity);
 }
コード例 #3
0
  public MapEditor(
      double FPS,
      double TPS,
      double APS,
      String backgroundPath,
      float gravity,
      int maxFallingSpeed,
      int blockWidth,
      int blockHeight,
      int moveSpeed,
      String mapPath) {
    super(FPS, TPS, APS, backgroundPath, gravity, maxFallingSpeed, mapPath);
    this.blockWidth = blockWidth;
    this.blockHeight = blockHeight;
    this.moveSpeed = moveSpeed;
    this.entities = new ArrayList<Entity>();
    this.things = new ArrayList<Thing>();
    this.currentCursorLocation = new Point(-999, -999);
    GameObjectFactory.configure(this.getMap());

    this.configureThings();
    this.configureEntities();
    this.currentSelectionIndex = 0;
    this.gameObjectsNum = 1;
    this.listingThings = true;
    this.selectedGameObject = this.things.get(this.currentSelectionIndex);
  }