Beispiel #1
0
  @Override
  public void init(GameContainer container, StateBasedGame game) throws SlickException {
    super.init(container, game);

    try {
      // Get our background
      this.setBackground(new Image(BCKGRND_IMG));

      // Add platforms
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(200, 450)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(400, 400)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(600, 300)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(810, 350)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(850, 350)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGC), new Vector2f(1140, 300)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGC), new Vector2f(1175, 300)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(1720, 400)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGC), new Vector2f(2000, 400)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(2450, 400)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(2510, 400)));
      this.addPlatform(new Platform(new Image(PLATFORM_IMGW), new Vector2f(2600, 450)));
      this.addPlatform(new Platform(new Image(MAIN_PLATFORM_IMG), new Vector2f(0, 580)));
      this.addPlatform(new Platform(new Image(MAIN_PLATFORM_IMG2), new Vector2f(900, 580)));
      this.addPlatform(new Platform(new Image(MAIN_PLATFORM_IMG4), new Vector2f(1300, 580)));
      this.addPlatform(new Platform(new Image(MAIN_PLATFORM_IMG2), new Vector2f(1800, 580)));
      this.addPlatform(new Platform(new Image(MAIN_PLATFORM_IMG2), new Vector2f(2200, 580)));
      this.addPlatform(new Platform(new Image(MAIN_PLATFORM_IMG4), new Vector2f(2800, 580)));

    } catch (SlickException e) {
      e.printStackTrace();
    }
  }
Beispiel #2
0
 @Override
 public void render(GameContainer container, StateBasedGame game, Graphics g)
     throws SlickException {
   super.render(container, game, g);
   // Our super renders all for us for now! Yay! :D
 }