feat: player
This commit is contained in:
parent
4a7006a48d
commit
a553ef99c6
|
@ -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: {},
|
||||
|
|
3
app/ecs-components/player.js
Normal file
3
app/ecs-components/player.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
import Component from '@/ecs/component.js';
|
||||
|
||||
export default class Player extends Component {}
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user