From d5750294b1169e85cc1171aa85b2ea522656d8b2 Mon Sep 17 00:00:00 2001 From: phat_sumo Date: Fri, 1 Apr 2022 17:43:56 -0600 Subject: add new entities. they still need new components as we add them --- src/entities/wall.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/entities/wall.js (limited to 'src/entities/wall.js') diff --git a/src/entities/wall.js b/src/entities/wall.js new file mode 100644 index 0000000..55226d0 --- /dev/null +++ b/src/entities/wall.js @@ -0,0 +1,13 @@ +game.createWall = () => { + const wall = game.Entity(); + wall.addComponent(game.components.Position({x: 0, y: 0})); + wall.addComponent(game.components.Appearance({rot: 0, width: 100, height: 100})); + wall.sprite = game.graphics.Sprite({ + image: game.assets.wall, + spriteHeight: 24, + spriteWidth: 24, + numFrames: 3, + timePerFrame: 100, + }); + return wall; +} -- cgit v1.2.3-70-g09d2