add cast times and cooldowns

This commit is contained in:
2025-01-12 03:30:52 +09:00
parent 2eb914a680
commit e0dd7dcaf3
7 changed files with 142 additions and 47 deletions
+2 -2
View File
@@ -172,6 +172,8 @@ function connectWebSocket() {
entity.position.set(e.position.x / 100, e.position.y / 100, e.radius / 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.radius / 100) + hpMargin, 0)
@@ -188,7 +190,6 @@ function connectWebSocket() {
entities[e.id] = entity
}
// entity.position.set(e.position.x / 100, e.position.y / 100, e.radius / 100)
positionTweens[entity.id] = new Tween(entity.position).to({ x: e.position.x / 100, y: e.position.y / 100, z: e.radius / 100 }, tweenDuration).start()
const hp = entity.children.at(0).children.at(0)
@@ -217,7 +218,6 @@ function connectWebSocket() {
}
projectile.userData.flaggedForRemoval = false
// projectile.position.set(p.position.x / 100, p.position.y / 100, p.visualHeight / 100)
positionTweens[projectile.id] = new Tween(projectile.position).to({ x: p.position.x / 100, y: p.position.y / 100, z: p.visualHeight / 100 }, tweenDuration).start()
}
+2
View File
@@ -63,6 +63,8 @@
<p>Connection: <span id="connection"></span></p>
<pre id="state"></pre>
</div>
<!-- TODO: HUD -->
<!-- TODO: cast indicator -->
<script type="module" src="client.js"></script>
</body>
</html>