Package it.marteEngine.entity

Examples of it.marteEngine.entity.Entity


      if (speed.x > 0)
        this.faceRight = true;
      else
        this.faceRight = false;

      Entity player = collide(PLAYER, x, y - 1);
      if (player != null) {
        toRemove = true;
        ((PlatformerEntity) player).jump();
        FuzzyGameWorld.addPoints(100);
      }
View Full Code Here


  public static void addPoints(int i) {
    FuzzyGameWorld.points += 100;
  }

  public Vector2f getPlayerCenter() {
    Entity ent = find(FuzzyPlayer.PLAYER);
    if (ent != null) {
      return new Vector2f(ent.x + ent.width / 2, ent.y + ent.height / 2);
    }
    return null;
  }
View Full Code Here

  public void update(GameContainer container, int delta)
      throws SlickException {
    super.update(container, delta);

    if (!fade) {
      Entity player = collide(PLAYER, x, y + height + 1);
      if (player != null && player instanceof FuzzyPlayer) {
        ((FuzzyPlayer) player).y = y + height + 1;
        fade = true;
        if (Math.random() > 0.5) {
          ME.world.add(new Star(x, y), World.GAME);
View Full Code Here

    super.update(container, delta);

    if (!toRemove) {
      super.update(container, delta);
      ty = y;
      Entity player = collide(PLAYER, x, y - 1);
      if (player != null) {
        toRemove = true;
        ((PlatformerEntity) player).jump();
        FuzzyGameWorld.addPoints(100);
      }
View Full Code Here

      throws SlickException {
    super.update(container, delta);

    motion.update(delta);

    Entity ent = collide(TargetBlock.TARGET_BLOCK, x, y);
    if (ent != null) {
      ME.world.remove(this);
      ME.world.remove(ent);
      return;
    }

    Entity player = collide(PLAYER, x, y);
    if (player != null) {
      ((FuzzyPlayer) player).damage(30);
    }

    if (motion != null) {
View Full Code Here

      // we are playing tricks here: to avoid modifying the TopDownActor
      // class we
      // retrieve the players from the world and rotate them too
      for (String name : rotatingPlayers) {
        Entity player = world.find(name);
        if (player != null)
          player.setAngle(this.getAngle());
      }
    } else if ("scaleMe".equals(alarmName)) {
      this.scale += scaleDir;
      if (this.scale <= 0.1f || this.scale >= 2.0f)
        scaleDir *= -1;

      for (String name : scalingPlayers) {
        Entity player = world.find(name);
        if (player != null)
          player.scale = this.scale;
      }
    } else if ("alphaMe".equals(alarmName)) {
      float alpha = this.getAlpha();
      this.setAlpha(alpha + alphaDir);
      alpha = this.getAlpha();
      if (alpha <= 0.1f || alpha >= 1.0f)
        alphaDir = -alphaDir;

      for (String name : alphaPlayers) {
        Entity player = world.find(name);
        if (player != null)
          player.setAlpha(this.getAlpha());
      }
    }
  }
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

  }

  public void update(GameContainer container, int delta) {
    radarCircle = new Circle(e.x + e.width / 2, e.y + e.height / 2, radar);

    Entity p = ME.world.find(Player.PLAYER);
    if (ray == null) {
      ray = new Ray(e, p);
    }

    if (ray != null) {
      Entity pl = ME.world.find(Player.PLAYER);
      ray.update(e, pl);
      Vector2f point = ray.line.getEnd();
      Vector2f cur = new Vector2f(e.x, e.y);
      cur = cur.sub(point);
      cur = cur.normalise();
View Full Code Here

      tx = x + 5;
    } else {
      tx = x - 5;
    }

    Entity ent = collide(new String[] { PLAYER, SOLID }, tx, y);
    if (ent != null) {
      if (ent instanceof FuzzyPlayer) {
        FuzzyPlayer fp = (FuzzyPlayer) ent;
        fp.damage(-1);
      }
View Full Code Here

      } else if (!faceRight && collide(SOLID, x - 1, y) != null) {
        faceRight = true;
        setAnim("moveRight");
      }
      ty = y;
      Entity player = collide(PLAYER, x, y - 1);
      if (player != null) {
        toRemove = true;
        ((PlatformerEntity) player).jump();
        FuzzyGameWorld.addPoints(100);
      }
View Full Code Here

TOP

Related Classes of it.marteEngine.entity.Entity

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.