fix auto-attack targeting

This commit is contained in:
2025-01-13 11:45:26 +09:00
parent 49a4d3e924
commit 03bbea4862
8 changed files with 32 additions and 134 deletions
-9
View File
@@ -184,8 +184,6 @@ function connectWebSocket() {
entity.position.set(e.position.x / 100, e.position.y / 100, e.height / 100)
scene.add(entity)
// TODO: player model out of basic geometries
const hpMargin = 0.4
const maxHp = new THREE.Sprite(new THREE.SpriteMaterial({ color: 0xd03333 }))
maxHp.position.set(0, (e.height / 100) + hpMargin, 0)
@@ -386,13 +384,6 @@ window.addEventListener('load', () => {
if (event.code == 'KeyE') {
websocket.send(JSON.stringify({ action: 'cast', slot: 3, id: playerId, x, y }))
}
if (event.code == 'KeyD') {
websocket.send(JSON.stringify({ action: 'teleport', id: playerId, x, y }))
}
if (event.code == 'KeyF') {
websocket.send(JSON.stringify({ action: 'teleport', id: playerId, x, y }))
}
}
})