forked from noxious/client
Loading world works
This commit is contained in:
@ -18,7 +18,7 @@ export async function login(username: string, password: string, gameStore = useG
|
||||
const response = await axios.post(`${config.server_endpoint}/login`, { username, password })
|
||||
useCookies().set('token', response.data.token as string, {
|
||||
// for whole domain
|
||||
domain: window.location.hostname.split('.').slice(-2).join('.'),
|
||||
domain: window.location.hostname.split('.').slice(-2).join('.')
|
||||
})
|
||||
return { success: true, token: response.data.token }
|
||||
} catch (error: any) {
|
||||
|
@ -18,13 +18,13 @@ export function tileToWorldXY(layer: Phaser.Tilemaps.TilemapLayer, pos_x: number
|
||||
}
|
||||
|
||||
export function tileToWorldX(layer: Phaser.Tilemaps.TilemapLayer, pos_x: number, pos_y: number): number {
|
||||
const worldPoint = layer.tileToWorldXY(pos_x, pos_y);
|
||||
return worldPoint.x + config.tile_size.x / 2;
|
||||
const worldPoint = layer.tileToWorldXY(pos_x, pos_y)
|
||||
return worldPoint.x + config.tile_size.x / 2
|
||||
}
|
||||
|
||||
export function tileToWorldY(layer: Phaser.Tilemaps.TilemapLayer, pos_x: number, pos_y: number): number {
|
||||
const worldPoint = layer.tileToWorldXY(pos_x, pos_y);
|
||||
return worldPoint.y + config.tile_size.y * 1.5;
|
||||
const worldPoint = layer.tileToWorldXY(pos_x, pos_y)
|
||||
return worldPoint.y + config.tile_size.y * 1.5
|
||||
}
|
||||
|
||||
export function placeTile(zone: Tilemap, layer: TilemapLayer, x: number, y: number, tileName: string) {
|
||||
@ -39,4 +39,4 @@ export function setAllTiles(zone: Tilemap, layer: TilemapLayer, tiles: string[][
|
||||
placeTile(zone, layer, x, y, tile)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user