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; }
@Override public void render(World world, Layer layer) { RenderEngine.resetColor(); sprite.render((move / 40) % sprite.texturePos.length, getTexturePos()); }