Browse Source

fixes, and toned down compression on track3.mp3

master
mortie 7 years ago
parent
commit
5f96062036
4 changed files with 9 additions and 7 deletions
  1. BIN
      assets/nsfw/soundtracks/track3.mp3
  2. BIN
      assets/sfw/soundtracks/track3.mp3
  3. 6
    6
      js/entities.js
  4. 3
    1
      js/game.js

BIN
assets/nsfw/soundtracks/track3.mp3 View File


BIN
assets/sfw/soundtracks/track3.mp3 View File


+ 6
- 6
js/entities.js View File

@@ -66,10 +66,13 @@ function Player(game) {
this.invincibleTimeout = null;
this.started = false;
this.rotation = 0;
this.bigBox = new Box(60, 40, { x: -30, y: -20 });
this.bigBox = new Box(0, 0);
this.box = new Box();
this.shape.push(this.box);

this.bigShape = new Shape(this);
this.bigShape.push(new Box(100, 70, { x: -50, y: -35 }));

this.erectLevel = 0;
this.rise();

@@ -139,13 +142,10 @@ Player.prototype.update = function() {
if (ent === this)
continue;

if (!this.shape.collidesWith(ent.shape))
continue;

if (ent instanceof Obstacle) {
if (ent instanceof Obstacle && this.shape.collidesWith(ent.shape)) {
this.lower();
return;
} else if (ent instanceof PowerUp) {
} else if (ent instanceof PowerUp && this.bigShape.collidesWith(ent.shape)) {
this.rise();
ent.dead = true;
}

+ 3
- 1
js/game.js View File

@@ -205,6 +205,7 @@ Game.prototype.update = function() {
if (ent.dead) {
if (i + 1 === this.entities.length) {
this.entities.pop();
continue;
} else {
this.entities[i] = this.entities.pop();
ent = this.entities[i];
@@ -242,8 +243,9 @@ Game.prototype.update = function() {

// Remove dead entities, replace them with the last entity
if (ent.dead) {
if (i + 1 === this.entities.length) {
if (i + 1 === layer.length) {
layer.pop();
continue;
} else {
layer[j] = layer.pop();
ent = layer[j];

Loading…
Cancel
Save