summaryrefslogtreecommitdiff
path: root/src/entities/liquid.js
blob: 27026d6b54ff212272743223fa4c168902718d23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
game.createLiquid = () => {
  // TODO: Split this into two entities: water and lava
  const liquid = game.Entity();
  liquid.addComponent(game.components.LoadPriority({priority: 5}));
  liquid.addComponent(game.components.Position({x: 0, y: 0}));
  liquid.addComponent(game.components.Appearance({rot: 0, width: 100, height: 100}));
  liquid.addComponent(game.components.Alive());
  liquid.sprite = game.graphics.Sprite({
    image: game.assets.liquid,
    spriteHeight: 24,
    spriteWidth: 24,
    numFrames: 3,
    timePerFrame: 100,
  });
  return liquid;
}