fix ghostable entities being pushed by ghosted entities

This commit is contained in:
2025-01-22 00:16:07 +09:00
parent fa2dbb5237
commit 916bc31356
4 changed files with 14 additions and 50 deletions
+8 -37
View File
@@ -9,37 +9,6 @@ export class Dungeon {
game.width = 3000
game.height = 3000
// const playerSpawn = new Vector2(game.width / 2, game.height / 2)
// game.spawnEntity(new Entity(Template.player({ id: '1', spawnPosition: playerSpawn, position: new Vector2(playerSpawn.x - 1300, playerSpawn.y - 500), team: Team.blue })))
// const dummyLogic = function dummyLogic() {
// const entity = this
// if (entity.position.x > 1250) {
// entity.moveAction(new Vector2(500, entity.position.y))
// }
// else if (entity.position.x < 550 || entity.destination == null) {
// entity.moveAction(new Vector2(1300, entity.position.y))
// }
// if (game.currentTick > 0 && game.currentTick % (6 * game.tickRate) == 0) {
// entity.castAction('q', playerSpawn)
// }
// }
// const dummy = { radius: 100, visualRadius: 50, abilities: { q: Ability.straightShot.id }, logic: dummyLogic }
// game.spawnEntity(new Entity({ ...dummy, position: new Vector2(1 * (game.width / 5), 1 * (game.height / 4)) }))
// game.spawnEntity(new Entity({ ...dummy, position: new Vector2(1 * (game.width / 5), 3 * (game.height / 4)) }))
// game.addTerrain(new Terrain([
// new Vector2(3.5 * (game.width / 10), 1.6 * (game.height / 5)),
// new Vector2(3.5 * (game.width / 10), 1.4 * (game.height / 5)),
// new Vector2(4 * (game.width / 10), 1.4 * (game.height / 5)),
// new Vector2(4 * (game.width / 10), 1.6 * (game.height / 5)),
// ]))
// game.addTerrain(new Terrain([
// new Vector2(3 * (game.width / 10), 2 * (game.height / 5)),
// new Vector2(3 * (game.width / 10), 1 * (game.height / 5)),
// new Vector2(4 * (game.width / 10), 1 * (game.height / 5)),
// new Vector2(4 * (game.width / 10), 2 * (game.height / 5)),
// ], false))
const from = new Vector2(100, 100)
game.height = 2000
game.spawnEntity(new Entity(Template.player({ id: '1', spawnPosition: from, pathfindingObstacleLimit: 1, pathfindingCooldown: 0 })))
@@ -66,12 +35,14 @@ export class Ravine {
this.terrains.map((points) => new Terrain(points.map((p) => p.multiplyScalar(1.6)))).forEach((terrain) => game.addTerrain(terrain))
game.logic = this.logic.bind(game)
const player1 = new Entity(Template.player({
id: '1',
spawnPosition: new Vector2(500, 150),
team: Team.blue,
}))
game.spawnEntity(player1)
for (let i = 1; i <= 10; i++) {
const team = i > 5 ? Team.blue : Team.red
game.spawnEntity(new Entity(Template.player({
id: `${i}`,
spawnPosition: new Vector2(500, 150),
team,
})))
}
game.start()
}