add visualRadius
This commit is contained in:
+18
-30
@@ -37,24 +37,29 @@ app.ws('/ws', async (req, res) => {
|
||||
console.log(message)
|
||||
}
|
||||
|
||||
let delay = 0
|
||||
// if(message.id == '1') {
|
||||
// delay = 45
|
||||
// }
|
||||
|
||||
if (message.action == 'attack') {
|
||||
entity.attackAction(new Vector2(message.x, message.y))
|
||||
setTimeout(() => entity.attackAction(new Vector2(message.x, message.y)), delay)
|
||||
}
|
||||
|
||||
if (message.action == 'cast') {
|
||||
entity.castAction(message.slot, new Vector2(message.x, message.y))
|
||||
setTimeout(() => entity.castAction(message.slot, new Vector2(message.x, message.y)), delay)
|
||||
}
|
||||
|
||||
if (message.action == 'halt') {
|
||||
entity.haltAction()
|
||||
setTimeout(() => entity.haltAction(), delay)
|
||||
}
|
||||
|
||||
if (message.action == 'stop') {
|
||||
entity.stopAction()
|
||||
setTimeout(() => entity.stopAction(), delay)
|
||||
}
|
||||
|
||||
if (message.action == 'move') {
|
||||
entity.moveAction(new Vector2(message.x, message.y))
|
||||
setTimeout(() => entity.moveAction(new Vector2(message.x, message.y)), delay)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -68,13 +73,13 @@ function laneScenario() {
|
||||
game.spawnEntity(player1)
|
||||
player1.attackAction(new Vector2(500, 150))
|
||||
|
||||
// const player2 = new Entity(Template.player({
|
||||
// id: '2',
|
||||
// spawnPosition: new Vector2(1600, 1800),
|
||||
// team: Team.red,
|
||||
// }))
|
||||
// game.spawnEntity(player2)
|
||||
// player2.attackAction(new Vector2(1600, 1800))
|
||||
const player2 = new Entity(Template.player({
|
||||
id: '2',
|
||||
spawnPosition: new Vector2(1600, 1800),
|
||||
team: Team.red,
|
||||
}))
|
||||
game.spawnEntity(player2)
|
||||
player2.attackAction(new Vector2(1600, 1800))
|
||||
|
||||
const midWallStart = new Vector2(600, 600)
|
||||
const midWallEnd = new Vector2(1400, 1400)
|
||||
@@ -116,24 +121,7 @@ function laneScenario() {
|
||||
game.spawnEntity(new Entity(Template.minion(Team.red, { ranged: true, route: redRoute })))
|
||||
}
|
||||
}
|
||||
// game.logic = gameLogic
|
||||
|
||||
// const uBottomPoints = [
|
||||
// midSouthWallPoints.at(0).clone().sub(midWallThickness),
|
||||
// midSouthWallPoints.at(1).clone().sub(midWallThickness),
|
||||
// midNorthWallPoints.at(-2).clone().add(midWallThickness),
|
||||
// midNorthWallPoints.at(-1).clone().add(midWallThickness),
|
||||
// ]
|
||||
// const uBottom = new Terrain(uBottomPoints)
|
||||
// uBottom.id = 'uBottom'
|
||||
// game.addTerrain(uBottom)
|
||||
|
||||
const minion = new Entity({...Template.minion(Team.red, { ranged: true }), logic: null})
|
||||
minion.teleport(new Vector2(850, 250))
|
||||
game.spawnEntity(minion)
|
||||
|
||||
player1.stopAction()
|
||||
player1.castAction(1, new Vector2(850, 250))
|
||||
game.logic = gameLogic
|
||||
}
|
||||
|
||||
app.listen(port, () => {
|
||||
|
||||
Reference in New Issue
Block a user