Package org.sfaci.jumper2dx.characters

Examples of org.sfaci.jumper2dx.characters.Platform


  /**
   * Carga las plataformas móviles de la pantalla actual
   */
  public void loadPlatforms() {
   
    Platform platform = null;
   
    // Carga los objetos móviles del nivel actual
    for (MapObject object : map.getLayers().get("objects").getObjects()) {
     
      if (object instanceof RectangleMapObject) {
        RectangleMapObject rectangleObject = (RectangleMapObject) object;
        if (rectangleObject.getProperties().containsKey(TiledMapManager.MOBILE)) {
          Rectangle rect = rectangleObject.getRectangle();
         
          Direction direction = null;
          if (Boolean.valueOf((String) rectangleObject.getProperties().get("right_direction")))
            direction = Direction.RIGHT;
          else
            direction = Direction.LEFT;
         
          platform = new Platform(rect.x, rect.y, TiledMapManager.PLATFORM_WIDTH, TiledMapManager.PLATFORM_HEIGHT,
                        Integer.valueOf((String) rectangleObject.getProperties().get("offset")), direction);
          platforms.add(platform);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.sfaci.jumper2dx.characters.Platform

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.