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
One Paragraph of project description goes here
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.
Give examples
We use SemVer for versioning.