Package objects

Examples of objects.Platform


  }
  public static void newLevel() {
    switch (level++) {
    case 1:
      platforms = new Platform[] {
          new Platform(0, Constants.getHeight()-20, Constants.getWidth(), 20, -1),
          new Platform(200, Constants.getHeight()-Shifter.getMaxJumpHeight()*4+40, 25, Constants.getHeight()+180, 0),
          new Platform(0, Constants.getHeight()-Shifter.getMaxJumpHeight(), 200-Shifter.WIDTH*2, 20, 0),
          new Platform(Shifter.WIDTH*2, Constants.getHeight()-Shifter.getMaxJumpHeight()*2+20, 200-Shifter.WIDTH*2, 20, 0),
          new Platform(0, Constants.getHeight()-Shifter.getMaxJumpHeight()*3+40, 200-Shifter.WIDTH*2, 20, 0),
          new Platform(Shifter.WIDTH*2, Constants.getHeight()-Shifter.getMaxJumpHeight()*4+40, 200-Shifter.WIDTH*2, 20, 0),
          new Platform(0, Constants.getHeight()-Shifter.getMaxJumpHeight()*4-Shifter.HEIGHT*2, Constants.getWidth(), 20, 0)
      };
      portals = new Portal[] {
          new FinishPortal(Constants.getWidth()-FinishPortal.DIAMETER-20, Constants.getHeight()-20-FinishPortal.DIAMETER-10, 0)
      };
      break;
View Full Code Here


      break;

      // Level Creator
    case KeyEvent.VK_BACK_QUOTE:
      for (int i=0; i<LevelCreator.platforms_lc.size(); i++) {
        final Platform pl = LevelCreator.platforms_lc.get(i);
        System.out.println(i + " " + pl.x + " " + pl.y + " " + pl.width + " " + pl.height);
      }
      break;
    case KeyEvent.VK_R:
      for (Platform pl : LevelCreator.platforms_lc) {
View Full Code Here

  private static int lc, lcX, lcY, lcWidth, lcHeight;

  public void mousePressed(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON3) {
      for (int i=0; i<platforms_lc.size(); i++) {
        final Platform pl = platforms_lc.get(i);
        if (pl.intersects(e.getX(), e.getY(), 1, 1)) {
          platforms_lc.remove(pl);
          i--;
        }
      }
      return
    }
    if (lc++ == 0) {
      lcX = e.getX();
      lcY = e.getY();
    } else {
      lc = 0;
      if (e.getX() > lcX) {
        lcWidth = e.getX()-lcX;
      } else if (e.getX() < lcX) {
        final int tempX = lcX;
        lcX = e.getX();
        lcWidth = tempX-e.getX();
      } else return;
      if (e.getY() > lcY) {
        lcHeight = e.getY()-lcY;
      } else if (e.getY() < lcY) {
        final int tempY = lcY;
        lcY = e.getY();
        lcHeight = tempY-e.getY();
      } else return;

      platforms_lc.add(new Platform(lcX, lcY, lcWidth, lcHeight, 0));
    }
  }
View Full Code Here

        if (obj.y < obj.startY)
          obj.y+=obj.startY-obj.y;
    }
  }
  public static void addObject(int x, int y, int width, int height, int phase) {
    addObject(new Platform(x, y, width, height, phase));
  }
View Full Code Here

TOP

Related Classes of objects.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.