add camera movement
This commit is contained in:
+2
-2
@@ -3,8 +3,8 @@ import { EventEmitter } from 'node:events'
|
||||
export default class Game {
|
||||
tickRate = 30
|
||||
currentTick = 0
|
||||
width = 1000
|
||||
height = 1000
|
||||
width = 4000
|
||||
height = 4000
|
||||
|
||||
#entities = []
|
||||
#eventEmitter = new EventEmitter()
|
||||
|
||||
+9
-4
@@ -48,15 +48,20 @@ app.listen(port, () => {
|
||||
|
||||
const entity2 = new Entity()
|
||||
entity2.id = '2'
|
||||
entity2.teleport(800, 100)
|
||||
entity2.teleport(35, 35)
|
||||
entity2.radius = 35
|
||||
game.spawn_entity(entity2)
|
||||
|
||||
const vertices = [
|
||||
{ x: 400, y: 400 },
|
||||
{ x: 600, y: 400 },
|
||||
{ x: 600, y: 600 },
|
||||
{ x: 400, y: 200 },
|
||||
{ x: 600, y: 200 },
|
||||
{ x: 700, y: 300 },
|
||||
{ x: 650, y: 600 },
|
||||
{ x: 400, y: 600 },
|
||||
{ x: 400, y: 450 },
|
||||
{ x: 600, y: 500 },
|
||||
{ x: 600, y: 300 },
|
||||
{ x: 400, y: 300 },
|
||||
]
|
||||
|
||||
const terrain1 = new Terrain(vertices)
|
||||
|
||||
Reference in New Issue
Block a user