Package it.marteEngine.actor

Examples of it.marteEngine.actor.StaticActor


  @Override
  public void initStatesList(GameContainer container) throws SlickException {
    initRessources();

    StaticActor helloWorld = new StaticActor(300, 250, 35, 35,
        ResourceManager.getImage("hello"));
    World world = new World(0, container);
    world.add(helloWorld);

    addState(world);
View Full Code Here


            if (type.equals("entity"))
              blocked[w][h] = NO_SOLID;
            if (img != null) {
              if (type.equalsIgnoreCase("background")) {
                // background
                StaticActor te = new StaticActor(w
                    * img.getWidth(), h * img.getHeight(),
                    img.getWidth(), img.getHeight(), img);
                te.collidable = false;
                te.depth = -100;
                te.collidable = false;
                te.setAlpha(0.4f);
                add(te);
              } else if (type.equalsIgnoreCase("star")) {
                starsNumber++;
                // stars
                Star star = new Star(w * img.getWidth(), h
                    * img.getHeight());
                add(star);
              } else if (type.equalsIgnoreCase("enemies")) {
                String enemyType = map.getTileProperty(tid,
                    "type", null);
                if (enemyType != null) {
                  if (enemyType.equalsIgnoreCase("slime")) {
                    // slime
                    add(new FuzzyGreenSlime(w * 32, h * 32));
                  } else if (enemyType
                      .equalsIgnoreCase("bat")) {
                    // slime
                    add(new FuzzyBat(w * 32, h * 32));
                  } else if (enemyType
                      .equalsIgnoreCase("arrowTrap")) {
                    // slime
                    add(new FuzzyArrowTrap(w * 32, h * 32));
                  } else if (enemyType
                      .equalsIgnoreCase("boss1")) {
                    // slime
                    add(new FuzzyBoss(w * 32, h * 32));
                  }
                }
              } else {
                String tileType = map.getTileProperty(tid,
                    "type", null);
                if (tileType != null
                    && tileType.equals("spikes")) {
                  // spike
                  Spike spike = new Spike(w * img.getWidth(),
                      h * img.getHeight());
                  add(spike);
                } else if (tileType != null
                    && tileType.equals("fuzzyBlock")) {
                  // fuzzyBlock
                  FuzzyBlock fz = new FuzzyBlock(w
                      * img.getWidth(), h
                      * img.getHeight(), img);
                  add(fz);
                } else if (tileType != null
                    && tileType.equals("tappo")) {
                  // FuzzyDestroyableBlock
                  FuzzyDestroyableBlock fd = new FuzzyDestroyableBlock(
                      w * img.getWidth(), h
                          * img.getHeight(), img);
                  add(fd);
                } else if (tileType != null
                    && tileType.equals("targetBlock")) {
                  // targetBlock
                  TargetBlock fz = new TargetBlock(w
                      * img.getWidth(), h
                      * img.getHeight(), img);
                  add(fz);
                } else {

                  // blocks
                  StaticActor te = new StaticActor(w
                      * img.getWidth(), h
                      * img.getHeight(), img.getWidth(),
                      img.getHeight(), img);
                  if (type.equals("entity")) {
                    blocked[w][h] = SOLID;
View Full Code Here

            Image img = map.getTileImage(w, h, layerIndex);
            if (img != null) {
              // load entity from Tiled map position and set Image
              // for static actor using image reference stored
              // into tiled map
              StaticActor te = new StaticActor(
                  w * img.getWidth(), h * img.getHeight(),
                  img.getWidth(), img.getHeight(), img);
              add(te);
              loaded++;
            }
View Full Code Here

    add(new PongBarActor(20, container.getHeight() / 2, "player1",
        Input.KEY_W, Input.KEY_S));
    add(new PongBarActor(container.getWidth() - 26,
        container.getHeight() / 2, "player2", Input.KEY_UP,
        Input.KEY_DOWN));
    add(new StaticActor(0, 0, container.getWidth(), 1, ""));
    add(new StaticActor(0, container.getHeight(), container.getWidth(), 1,
        ""));

    newBallTimer = 0;

    resetScore();
View Full Code Here

    // create player
    TopDownActor player = new TopDownActor(400, 400, "data/link.png");
    // create sword relative to player
    Sword sword = new Sword(player.x, player.x, "data/sword.png", player);
    // create temple
    StaticActor temple = new StaticActor(150, 150, 48, 48,
        "data/tiles.png", 0, 6);

    // add entities
    gameWorld.add(player);
    gameWorld.add(temple);
View Full Code Here

    for (int i = 0; i < getWidth(); i++) {
      for (int j = 0; j < getHeight(); j++) {
        int tileID = getTileId(i, j, blocksIndex);
        if (Boolean.valueOf(getTileProperty(tileID, "solid", "false"))) {

          StaticActor block = new StaticActor(i * 32, j * 32, 32, 32,
              "data/block.png");
          ME.world.add(block);
        }
      }
    }
View Full Code Here

  @Override
  public void initStatesList(GameContainer container) throws SlickException {

    World state = new World(0, container);

    Entity e = new StaticActor(100, 100, 100, 100, "data/cross.png");
    e.speed = new Vector2f(8, 8);
    e.stateManager.addAll(new IdleState(e), new MovingState(e),
        new CombatState(e));
    state.add(e);
View Full Code Here

TOP

Related Classes of it.marteEngine.actor.StaticActor

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.