71 lines
1.4 KiB
JavaScript
71 lines
1.4 KiB
JavaScript
export default async function createPlayer(id) {
|
|
const player = {
|
|
Camera: {},
|
|
Collider: {
|
|
bodies: [
|
|
{
|
|
points: [
|
|
{x: -4, y: -4},
|
|
{x: 3, y: -4},
|
|
{x: 3, y: 3},
|
|
{x: -4, y: 3},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
Controlled: {},
|
|
Direction: {direction: 2},
|
|
Ecs: {path: ['homesteads', `${id}`].join('/')},
|
|
Emitter: {},
|
|
Forces: {},
|
|
Interacts: {},
|
|
Interlocutor: {},
|
|
Inventory: {
|
|
slots: {
|
|
1: {
|
|
qty: 100,
|
|
source: '/assets/potion/potion.json',
|
|
},
|
|
2: {
|
|
qty: 1,
|
|
source: '/assets/watering-can/watering-can.json',
|
|
},
|
|
3: {
|
|
qty: 1,
|
|
source: '/assets/tomato-seeds/tomato-seeds.json',
|
|
},
|
|
4: {
|
|
qty: 1,
|
|
source: '/assets/hoe/hoe.json',
|
|
},
|
|
5: {
|
|
qty: 1,
|
|
source: '/assets/brush/brush.json',
|
|
},
|
|
},
|
|
},
|
|
Health: {health: 100},
|
|
Light: {},
|
|
Magnet: {strength: 24},
|
|
Player: {},
|
|
Position: {x: 128, y: 448},
|
|
Speed: {speed: 100},
|
|
Sound: {},
|
|
Sprite: {
|
|
anchorX: 0.5,
|
|
anchorY: 0.9,
|
|
animation: 'moving:down',
|
|
frame: 0,
|
|
source: '/assets/dude/dude.json',
|
|
speed: 0.115,
|
|
},
|
|
Ticking: {},
|
|
VisibleAabb: {},
|
|
Wielder: {
|
|
activeSlot: 0,
|
|
},
|
|
};
|
|
return player;
|
|
}
|
|
|