use the placeholder player model
This commit is contained in:
+4
-2
@@ -18,7 +18,7 @@ export default class Entity {
|
||||
dead = false
|
||||
ghosting = false
|
||||
health = null
|
||||
height = 40
|
||||
height = null
|
||||
maxHealth = 1
|
||||
position = null
|
||||
radius = 0
|
||||
@@ -43,7 +43,6 @@ export default class Entity {
|
||||
#pathfindingCooldown = 0
|
||||
#pathfindingObstacleLimit = null
|
||||
#projectilesInVision = []
|
||||
#queuedAction = null
|
||||
#spawnPosition = new Vector2()
|
||||
|
||||
static bbox(x, y, radius) {
|
||||
@@ -141,6 +140,9 @@ export default class Entity {
|
||||
if (this.visualRadius == null) {
|
||||
this.visualRadius = this.radius
|
||||
}
|
||||
if (this.height == null) {
|
||||
this.height = this.visualRadius ?? this.radius
|
||||
}
|
||||
|
||||
this.#calculateCollider()
|
||||
}
|
||||
|
||||
+7
-1
@@ -23,6 +23,8 @@ app.use('/@tweenjs/', express.static('node_modules/@tweenjs'))
|
||||
app.use('/stats.js/', express.static('node_modules/stats.js'))
|
||||
|
||||
app.use('/', express.static('public'))
|
||||
app.use('/models', express.static('models'))
|
||||
|
||||
app.use('/tools/', express.static('tools'))
|
||||
|
||||
app.ws('/ws', async (req, res) => {
|
||||
@@ -31,6 +33,10 @@ app.ws('/ws', async (req, res) => {
|
||||
websocket.on('message', (rawData) => {
|
||||
const message = JSON.parse(rawData)
|
||||
console.info(message)
|
||||
if (message.action == 'entities') {
|
||||
websocket.send(JSON.stringify({ entities: game.entities.map((it) => it.id) }))
|
||||
}
|
||||
|
||||
if (message.action == 'join') {
|
||||
const id = message.id
|
||||
const connectionId = crypto.randomUUID()
|
||||
@@ -56,7 +62,7 @@ app.ws('/ws', async (req, res) => {
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.info({ event: 'startup', visit: `http://localhost:${port}` })
|
||||
console.info({ event: 'startup', visit: `http://localhost:${port}/menu/` })
|
||||
|
||||
Dungeon.scenario(game)
|
||||
})
|
||||
|
||||
+1
-7
@@ -6,11 +6,9 @@ export default class Template {
|
||||
static basilisk(overrides) {
|
||||
return {
|
||||
abilities: {},
|
||||
height: 100,
|
||||
logic: this.#basiliskLogic(),
|
||||
radius: 180,
|
||||
speed: 230,
|
||||
visualRadius: 170,
|
||||
maxHealth: 3000,
|
||||
...overrides,
|
||||
}
|
||||
@@ -19,17 +17,15 @@ export default class Template {
|
||||
static minion(team, options = {}) {
|
||||
return {
|
||||
abilities: { a: options.ranged ? Ability.rangedAttack.id : Ability.meleeAttack.id },
|
||||
height: options.ranged ? 40 : 38,
|
||||
logic: this.#minionLogic(options.route, (team != Team.blue)),
|
||||
maxHealth: options.ranged ? 300 : 450,
|
||||
pathfindingCooldown: 0.2,
|
||||
pathfindingObstacleLimit: 0,
|
||||
position: options.route?.at(0) ?? options.position ?? new Vector2(0, 0),
|
||||
radius: 48,
|
||||
radius: options.ranged ? 36 : 38,
|
||||
speed: 325,
|
||||
team,
|
||||
visionRange: 1200,
|
||||
visualRadius: options.ranged ? 36 : 38,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,14 +40,12 @@ export default class Template {
|
||||
d: Ability.circleOfResurrection.id,
|
||||
f: Ability.blink.id,
|
||||
},
|
||||
height: 80,
|
||||
logic: this.#playerLogic,
|
||||
maxHealth: 600,
|
||||
pathfindingObstacleLimit: 3,
|
||||
radius: 65,
|
||||
spawnPosition: new Vector2(500, 150),
|
||||
visionRange: 1350,
|
||||
visualRadius: 40,
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user