Beispiel #1
0
  @Override
  public void update(World world, DynamicLayer layer) {
    updateGroundData((CollisionPool) layer);
    input(layer);
    updateSpeed((CollisionPool) layer);
    xSpeed = Util.capFloat(xSpeed, -speed, +speed);

    move(world, (MainLayer) layer);
  }
Beispiel #2
0
  public MyPlayerEntity() {
    sprite = new AnimatedSprite("core;Spritesheet.png");
    sprite.texturePos =
        Util.makeTable(
            new RectangleI(5 * 32, 0, 32, 3 * 32),
            new RectangleI(6 * 32, 0, 32, 3 * 32),
            new RectangleI(7 * 32, 0, 32, 3 * 32),
            new RectangleI(8 * 32, 0, 32, 3 * 32));

    setBounds(0, 0, 32, 32 * 3);
    mass = 10;
    gravity = 1;
    jumpForce = 550 * mass;

    hardness = 0.95f;

    tileColliding = true;
    boxColliding = true;
  }