C .
ODE
G
AMELET
person_outline
Sign In
Name
2040279696044527.facebook
Email
Link
work
His Projects
add_circle_output
Project
image
His Resources
videogame_asset
His Builds
language
Search Others
search
visibility
code
OPEN
info_outline
sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }sprite: SpritesheetMovieClip; speed: number = 0.1; constructor() { this.sprite = CG.Base.resourceManager.createSpritesheetMovieClip('zombieGame.person'); this.sprite.pivot.set(this.sprite.width / 2, this.sprite.height / 2); this.sprite.position.set(CG.Base.pixi.stageWidth / 2, CG.Base.pixi.stageWidth - 100); CG.Base.pixi.root.addChild(this.sprite); this.sprite.scale.set(3, 3); CG.Base.addUpdateFunction(this, this.update); /* PIXI.keyboardManager.on('pressed', (key) => { if (key == PIXI.keyboard.Key.SPACE) { new Bullet(this.sprite.x, this.sprite.y - 30, 1); } });*/ } update(dt: number): void { let move: CG.Base.geom.Point = new CG.Base.geom.Point(0, 0); if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.RIGHT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.D)) { move.x = 1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.LEFT)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.A)) { move.x = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.UP)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.W)) { move.y = -1; } if (PIXI.keyboardManager.isDown(PIXI.keyboard.Key.DOWN)||PIXI.keyboardManager.isDown(PIXI.keyboard.Key.S)) { move.y = 1; } move.normalize(dt * this.speed); let edge: number = 20; let position: CG.Base.geom.Point = CG.Base.geom.Point.fromPIXIPoint(this.sprite.position); position.x = position.x + move.x; position.y = position.y + move.y; if (position.x < edge) { position.x = edge; } else if (position.x > CG.Base.pixi.stageWidth - edge) { position.x = CG.Base.pixi.stageWidth - edge; } edge = 30; if (position.y < edge) { position.y = edge; } else if (position.y > CG.Base.pixi.stageHeight - edge) { position.y = CG.Base.pixi.stageHeight - edge; } this.sprite.position.set(position.x, position.y); }ddddddddddddd # zombieGame One Paragraph of project description goes here ## Getting Started These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. ```typescript Give examples ``` ## Versioning We use [SemVer](http://semver.org/) for versioning. ## Authors * **[tonyo3o3](/profile/tonyo3o3)** ## Acknowledgments * Hat tip to anyone who's code was used * Inspiration * etc
6666666ppppp
2040279696044527.facebook
MORE RESULTS
â’¸Code.Gamelet.com |
Privacy Policy
|
Terms of Service