From 14ddb31441e35dce7425385948a9ee63b262cece Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Mon, 4 Apr 2022 15:30:56 -0600 Subject: Fix moveable components when multiple moveable entities --- src/game.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/game.js') diff --git a/src/game.js b/src/game.js index 7301f73..69a91ce 100644 --- a/src/game.js +++ b/src/game.js @@ -29,14 +29,13 @@ game.initialize = () => { Array(10).fill(null).forEach((_, i) => { const bigBlue = game.createBigBlue(); bigBlue.addComponent(game.components.GridPosition({x: Math.floor(Math.random() * 15), y: Math.floor(Math.random() * 13)})); - bigBlue.addComponent(game.components.Pushable()); + bigBlue.addComponent(game.components.Controllable({controls: ['left', 'right', 'up', 'down']})); game.entities[bigBlue.id] = bigBlue; }); game.rock = game.createRock(); game.rock.addComponent(game.components.Position({x: 200, y: 200})); game.rock.addComponent(game.components.GridPosition({x: 0, y: 0})); - game.rock.addComponent(game.components.Controllable({controls: ['left', 'right', 'up', 'down']})); game.rock.addComponent(game.components.Pushable()); game.entities[game.rock.id] = game.rock; -- cgit v1.2.3-70-g09d2