add vision
This commit is contained in:
+27
-1
@@ -1,11 +1,35 @@
|
||||
import { Vector2 } from 'three'
|
||||
import Ability from './ability.js'
|
||||
import Entity from './entity.js'
|
||||
import Team from './team.js'
|
||||
import Template from './template.js'
|
||||
import Terrain from './terrain.js'
|
||||
import Entity from './entity.js'
|
||||
|
||||
export class Dungeon {
|
||||
static scenario(game) {
|
||||
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, team: Team.blue })))
|
||||
game.entities.at(0).moveAction(playerSpawn.clone().add(new Vector2(0, -200)))
|
||||
const dummyLogic = function dummyLogic() {
|
||||
if (game.currentTick % (3 * game.tickRate) == 0) {
|
||||
this.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 * (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)),
|
||||
]))
|
||||
|
||||
game.start()
|
||||
}
|
||||
}
|
||||
|
||||
export class Ravine {
|
||||
@@ -21,6 +45,8 @@ export class Ravine {
|
||||
team: Team.blue,
|
||||
}))
|
||||
game.spawnEntity(player1)
|
||||
|
||||
game.start()
|
||||
}
|
||||
static logic() {
|
||||
const game = this
|
||||
|
||||
Reference in New Issue
Block a user