Permalink
Browse files

hehehehe

  • Loading branch information...
1 parent b9f8352 commit 5d58e8e2a0dc5e0fa8e4d0ee52a2c052cd3ee177 @severest severest committed Dec 1, 2012
Showing with 10 additions and 1 deletion.
  1. +9 −0 components.js
  2. +1 −1 game.js
View
@@ -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;
},
@@ -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);
}
});
View
@@ -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
});

0 comments on commit 5d58e8e

Please sign in to comment.