Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
jahepi-mx committed Feb 4, 2019
1 parent 976078b commit 62db2f1
Show file tree
Hide file tree
Showing 27 changed files with 88 additions and 58 deletions.
2 changes: 1 addition & 1 deletion assets/maps/level1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/maps/level2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified assets/sprites/separated_sprites/invisible1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible11.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible12.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible13.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible7.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible8.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/separated_sprites/invisible9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/sprites.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion door.js
Expand Up @@ -7,7 +7,7 @@ class Door extends Tile {
this.atlas = Atlas.getInstance();
this.assets = Assets.getInstance();
this.image = "door";
this.closeTime = 6;
this.closeTime = 2;
this.closeTimeCount = 0;
this.isClosingCountdown = false;
this.isMakingNoise = false;
Expand Down
4 changes: 2 additions & 2 deletions enemies/boss.js
@@ -1,6 +1,6 @@
class Boss {

constructor(x, y, velocity, map, shootTimeLimit) {
constructor(x, y, velocity, map, shootTimeLimit, life) {
this.map = map;
this.length = 25;
this.moves = [[-1, 0], [0, -1], [1, 0], [0, 1]];
Expand All @@ -26,7 +26,7 @@ class Boss {
this.fireAnimation = new Animation(3, 2);
this.fireAnimation.stopAtSequenceNumber(3, null);
this.fireAnimation.stop();
this.life = 30;
this.life = life;
this.isDead = false;
this.dispose = false;
this.randomShootTime = 0;
Expand Down
12 changes: 7 additions & 5 deletions enemies/dog.js
@@ -1,6 +1,6 @@
class Dog {

constructor(x, y, velocity, map, dirRadians) {
constructor(x, y, velocity, map, dirRadians, life) {
this.map = map;
this.length = 25;
this.moves = [[-1, 0], [0, -1], [1, 0], [0, 1]];
Expand Down Expand Up @@ -28,10 +28,11 @@ class Dog {
this.attackAnimation = new Animation(3, 2);
this.attackAnimation.stopAtSequenceNumber(3, null);
this.attackAnimation.stop();
this.life = 10;
this.life = life;
this.isDead = false;
this.dispose = false;
this.isAware = false;
this.hasFoundPlayer = false;
}

update(dt) {
Expand All @@ -47,12 +48,13 @@ class Dog {
if (this.searchTime > this.searchTimeLimit && this.isAware) {
this.path = [];
this.pathfinding();
if (!this.hasFoundPlayer) {
this.isAware = false;
}
this.searchTime = 0;
}
this.damageTime += dt;

// Disable door openning
/*
this.searchDoorTime += dt;
if (this.searchDoorTime > this.searchDoorTimeLimit) {
var currX = parseInt(this.position.x / this.map.tileLength);
Expand All @@ -69,7 +71,6 @@ class Dog {
}
this.searchDoorTime = 0;
}
*/

var playerVector = player.position.sub(this.position);
this.attackTime += dt;
Expand Down Expand Up @@ -204,6 +205,7 @@ class Dog {
}
//this.path.push(map.tiles[index].position);
}
this.hasFoundPlayer = toTileFound;
}

calculateDirection(dt) {
Expand Down
12 changes: 7 additions & 5 deletions enemies/soldier.js
@@ -1,6 +1,6 @@
class Soldier {

constructor(x, y, velocity, map, dirRadians, shootTimeLimit, shootDistance, unawarenessDistance, awarenessDistance) {
constructor(x, y, velocity, map, dirRadians, shootTimeLimit, shootDistance, unawarenessDistance, awarenessDistance, life) {
this.map = map;
this.length = 25;
this.moves = [[-1, 0], [0, -1], [1, 0], [0, 1]];
Expand Down Expand Up @@ -28,13 +28,14 @@ class Soldier {
this.fireAnimation = new Animation(2, 2);
this.fireAnimation.stopAtSequenceNumber(3, null);
this.fireAnimation.stop();
this.life = 10;
this.life = life;
this.isDead = false;
this.dispose = false;
this.isAware = false;
this.shootDistance = shootDistance === 0 ? 20000 : shootDistance;
this.unawarenessDistance = unawarenessDistance === 0 ? 200000 : unawarenessDistance;
this.awarenessDistance = awarenessDistance === 0 ? 150000 : awarenessDistance;
this.hasFoundPlayer = false;
}

update(dt) {
Expand All @@ -51,12 +52,13 @@ class Soldier {
if (this.searchTime > this.searchTimeLimit && this.isAware) {
this.path = [];
this.pathfinding();
if (!this.hasFoundPlayer) {
this.isAware = false;
}
this.searchTime = 0;
}
this.damageTime += dt;

// Disable door openning
/*
this.searchDoorTime += dt;
if (this.searchDoorTime > this.searchDoorTimeLimit) {
var currX = parseInt(this.position.x / this.map.tileLength);
Expand All @@ -73,7 +75,6 @@ class Soldier {
}
this.searchDoorTime = 0;
}
*/

var playerVector = player.position.sub(this.position);
this.shootTime += dt;
Expand Down Expand Up @@ -224,6 +225,7 @@ class Soldier {
}
//this.path.push(map.tiles[index].position);
}
this.hasFoundPlayer = toTileFound;
}

calculateDirection(dt) {
Expand Down

0 comments on commit 62db2f1

Please sign in to comment.