Skip to content

Commit

Permalink
hehehehe
Browse files Browse the repository at this point in the history
  • Loading branch information
severest committed Dec 1, 2012
1 parent b9f8352 commit 5d58e8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions components.js
Expand Up @@ -140,6 +140,7 @@ Crafty.c("MediumEnemy", {
this.requires("EnemyBase");
this.requires("RealDelay");
this.realDelay(this.blink, Crafty.math.randomInt(3000, 5000));
this.realDelay(this.fireWeapon, 3000);

this.scoreForKill = 200;
},
Expand All @@ -155,6 +156,14 @@ Crafty.c("MediumEnemy", {
this.animate("idle", 30, 0);
});
this.realDelay(this.blink, Crafty.math.randomInt(3000, 5000));
},
fireWeapon: function() {
Crafty.e("Bullet, 2D, DOM, Image, StraightBullets, HurtForky")
.image("imgs/onion_peel.png")
.attr({ x: this.x+(this.w/2), y: this.y+(this.h/2), z: 4, rotation: Crafty.math.randomInt(0, 360)})
.setSpeed(0,5,Crafty.math.randomInt(1, 5))
.origin("center");
this.realDelay(this.fireWeapon, 3000);
}

});
Expand Down
2 changes: 1 addition & 1 deletion game.js
Expand Up @@ -36,7 +36,7 @@ window.onload = function () {
"imgs/fireball.png", "imgs/minifork.png", "imgs/bacon2.png", "imgs/peppermint.png",
"imgs/onion_ss.png", "imgs/egg_ss.png", "imgs/eggbullet.png", "imgs/sky_bg.png",
"imgs/space_bar.png","imgs/arrow_keys.png","imgs/icecube.png","imgs/drink.png",
"imgs/rainbow_starburst.png"], function () {
"imgs/rainbow_starburst.png", "imgs/onion_peel.png"], function () {
Crafty.scene("title"); //when everything is loaded, run the main scene
});

Expand Down

0 comments on commit 5d58e8e

Please sign in to comment.