fix projectiles phasing through stuff

This commit is contained in:
2025-01-17 14:01:18 +09:00
parent 20f8a2f1fe
commit 787b48a4df
4 changed files with 41 additions and 25 deletions
+15 -9
View File
@@ -1,6 +1,5 @@
import { Vector2 } from 'three'
import { WebSocketExpress } from 'websocket-express'
import Ability from './ability.js'
import Entity from './entity.js'
import express from 'express'
import Game from './game.js'
@@ -69,13 +68,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)
@@ -117,7 +116,7 @@ function laneScenario() {
game.spawnEntity(new Entity(Template.minion(Team.red, { ranged: true, route: redRoute })))
}
}
game.logic = gameLogic
// game.logic = gameLogic
// const uBottomPoints = [
// midSouthWallPoints.at(0).clone().sub(midWallThickness),
@@ -128,6 +127,13 @@ function laneScenario() {
// 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))
}
app.listen(port, () => {