예제 #1
0
  public Input(GameContainer gc) {
    // this.gc = gc;

    gc.getWindow().getCanvas().addKeyListener(this);
    gc.getWindow().getCanvas().addMouseListener(this);
    gc.getWindow().getCanvas().addMouseMotionListener(this);
  }
예제 #2
0
 @Override
 public void dispose() {
   if (gameContainer == null) {
     return;
   }
   gameContainer.dispose();
 }
예제 #3
0
 @Override
 public void pause() {
   if (gameContainer == null) {
     return;
   }
   gameContainer.onPause();
 }
예제 #4
0
 @Override
 public void resume() {
   if (gameContainer == null) {
     return;
   }
   gameContainer.onResume();
 }
예제 #5
0
 @Override
 public void render() {
   if (gameContainer == null) {
     return;
   }
   gameContainer.render();
 }
예제 #6
0
 @Override
 public void interpolate(float alpha) {
   if (gameContainer == null) {
     return;
   }
   gameContainer.interpolate(alpha);
 }
예제 #7
0
 @Override
 public void update(float delta) {
   if (gameContainer == null) {
     return;
   }
   gameContainer.update(delta);
 }
예제 #8
0
 @Override
 public void resize(int width, int height) {
   if (gameContainer == null) {
     return;
   }
   gameContainer.resize(width, height);
 }
예제 #9
0
 @Override
 public void create() {
   initialise(gameIdentifier);
   gameContainer.start();
 }