add minimap
This commit is contained in:
+2
-2
@@ -61,8 +61,8 @@ export default class Entity {
|
||||
const speed = this.speed / (this.game?.tickBudget ?? 1000)
|
||||
if (this.#dest != null) {
|
||||
const fixedDest = new THREE.Vector2(
|
||||
Math.min(Math.max(this.radius, this.#dest.x), this.game?.width ?? Infinity),
|
||||
Math.min(Math.max(this.radius, this.#dest.y), this.game?.height ?? Infinity),
|
||||
Math.min(Math.max(this.radius, this.#dest.x), (this.game?.width ?? Infinity) - this.radius),
|
||||
Math.min(Math.max(this.radius, this.#dest.y), (this.game?.height ?? Infinity) - this.radius),
|
||||
)
|
||||
|
||||
const distance = this.position.clone().sub(fixedDest).length()
|
||||
|
||||
Reference in New Issue
Block a user