Package games.stendhal.common

Examples of games.stendhal.common.Direction


   * @param player player pushing
   * @param rpEntity entity pushed
   */
  private void tryPush(final Player player, final RPEntity rpEntity) {
    if (canPush(player, rpEntity)) {
      final Direction dir = player.getDirectionToward(rpEntity);

      final int x = rpEntity.getX() + dir.getdx();
      final int y = rpEntity.getY() + dir.getdy();

      final StendhalRPZone zone = player.getZone();
      if (!zone.collides(rpEntity, x, y)) {
        move(player, rpEntity, x, y);
        // Stop players running toward to make trapping harder. Don't
        // stop anyone just following a path (again to make annoying
        // others harder)
        if (dir.oppositeDirection() == rpEntity.getDirection()
            && !rpEntity.hasPath()) {
          rpEntity.stop();
        }
      }
    }
View Full Code Here

TOP

Related Classes of games.stendhal.common.Direction

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.