Пример #1
0
  public void updateGameOver(float delta) {

    position.add(velocity.cpy().scl(delta));

    if (position.x <= -getWidth()) {
      position.x = -getWidth() * 2;
    }
    bounds.setPosition(position);
  }
Пример #2
0
  public void update(float delta) {

    position.add(velocity.cpy().scl(delta));

    if (position.x <= -getWidth()) {
      position.x = Gdx.graphics.getWidth();
      position.y = ((float) (Math.random() * (max))) - 10;
    }
    bounds.setPosition(position);
  }
 public void setPosition(float x, float y) {
   this.x = x;
   this.y = y;
   sprite.setPosition(x, y);
   hitBox.setPosition(x, y);
 }
Пример #4
0
 public void reposition(float x) {
   posTopPipe.set(x, rand.nextInt(FLUCTUATION) + PIPE_GAP + LOWEST_OPENING);
   posBotPipe.set(x, posTopPipe.y - PIPE_GAP - bottomPipe.getHeight());
   boundsTop.setPosition(posTopPipe.x, posTopPipe.y);
   boundsBot.setPosition(posBotPipe.x, posBotPipe.y);
 }
Пример #5
0
 public void setPosition(float x, float y) {
   bounds.setPosition(x, y);
 }
 public void reposition(float x) {
   posTopTube.set(x, rand.nextInt(FLUCTUATION) + LOWEST_OPENING + TUBE_GAP);
   posBottomTube.set(x, posTopTube.y - TUBE_GAP - bottomTube.getHeight());
   boundsTop.setPosition(x, posTopTube.y);
   boundsBottom.setPosition(x, posBottomTube.y);
 }
Пример #7
0
 public void update() {
   Collision(gc.world);
   bound.setPosition(X, Y);
 }
Пример #8
0
 private void updateCollisionRectangle() {
   collisionRectangle.setPosition(x, y);
 }