diff --git a/app/create-player.js b/app/create-player.js index e3a930d..5b90e87 100644 --- a/app/create-player.js +++ b/app/create-player.js @@ -41,6 +41,7 @@ export default async function createPlayer(id) { }, Health: {health: 100}, Magnet: {strength: 24}, + Player: {}, Position: {x: 128, y: 128}, Speed: {speed: 100}, Sound: {}, diff --git a/app/ecs-components/player.js b/app/ecs-components/player.js new file mode 100644 index 0000000..0bb6007 --- /dev/null +++ b/app/ecs-components/player.js @@ -0,0 +1,3 @@ +import Component from '@/ecs/component.js'; + +export default class Player extends Component {} diff --git a/public/assets/shit-shack/collision-start.js b/public/assets/shit-shack/collision-start.js index beaf9b3..56747c9 100644 --- a/public/assets/shit-shack/collision-start.js +++ b/public/assets/shit-shack/collision-start.js @@ -1,16 +1,18 @@ for (let i = 0; i < intersections.length; ++i) { if (intersections[i][0].tags) { if (intersections[i][0].tags.includes('door')) { - ecs.switchEcs( - other, - entity.Ecs.path, - { - Position: { - x: 72, - y: 304, + if (other.Player) { + ecs.switchEcs( + other, + entity.Ecs.path, + { + Position: { + x: 72, + y: 304, + }, }, - }, - ); + ); + } } } }