Exemple #1
0
  /** Destroys both portals. */
  public void destroyPortals() {
    if (bluePortal != null) {
      level.addToRemove(bluePortal);
      bluePortal = null;
    }

    if (orangePortal != null) {
      level.addToRemove(orangePortal);
      orangePortal = null;
    }
  }
Exemple #2
0
  /** Creates a Portal of the specified color */
  private void createPortal(PortalColor color) {
    Portal portal = getPortal(color);

    if (portal == null) {
      portal = new Portal(level, raycast.getPosition(), color, raycast.getPortalNormal());

      level.add(portal);
      setPortal(portal);
      linkPortals();
    } else {
      portal.setPosition(raycast.getPosition());
      portal.setNormal(raycast.getPortalNormal());
    }
  }
Exemple #3
0
 public PortalGun(Level level, Entity owner) {
   super(level.getWorld(), owner);
   this.level = level;
   this.raycast = new PortalGunRayCast(level.getWorld());
 }