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

this.invincibleTimeout = null; this.invincibleTimeout = null;
this.started = false; this.started = false;
this.rotation = 0; this.rotation = 0;
this.bigBox = new Box(60, 40, { x: -30, y: -20 });
this.bigBox = new Box(0, 0);
this.box = new Box(); this.box = new Box();
this.shape.push(this.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.erectLevel = 0;
this.rise(); this.rise();


if (ent === this) if (ent === this)
continue; continue;


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

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

+ 3
- 1
js/game.js View File

if (ent.dead) { if (ent.dead) {
if (i + 1 === this.entities.length) { if (i + 1 === this.entities.length) {
this.entities.pop(); this.entities.pop();
continue;
} else { } else {
this.entities[i] = this.entities.pop(); this.entities[i] = this.entities.pop();
ent = this.entities[i]; ent = this.entities[i];


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

Loading…
Cancel
Save