Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

egg bullet sizing good now

  • Loading branch information...
commit cb3c2022ea3906a05087c2fe0aa501c7742ec85e 1 parent 76d2487
@severest severest authored
View
4 components.js
@@ -124,8 +124,8 @@ Crafty.c("SimpleEnemy", {
Crafty.e("Bullet, 2D, DOM, eggbullet, SpriteAnimation, StraightBullets, HurtForky")
.animate("go", 0, 0, 4)
.animate("go", 20, -1)
- .attr({ x: this.x, y: this.y, z: 4})
- .setSpeed(0,5,2)
+ .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, 1000);
}
View
4 game.js
@@ -16,7 +16,7 @@ window.onload = function () {
Crafty.sprite(20, 80, "imgs/bacon2.png", {firebacon:[0,0]});
Crafty.sprite(120, "imgs/burger_sheet.png", {burg:[0,0]});
Crafty.sprite(100,91, "imgs/egg_ss.png", {egg:[0,0]});
- Crafty.sprite(20,25, "imgs/eggbullet.png", {eggbullet:[0,0]});
+ Crafty.sprite(30,38, "imgs/eggbullet.png", {eggbullet:[0,0]});
Crafty.sprite(80,71, "imgs/onion_ss.png", {onion:[0,0]});
Crafty.sprite(100, "imgs/fireball.png", {fireball:[0,0]});
Crafty.sprite(39,36, "imgs/peppermint.png", {peppermint:[0,0]});
@@ -186,7 +186,7 @@ function spawnSimpleEnemy() {
// .setSpeed(1.5);
Crafty.e("Enemy, 2D, DOM, egg, SpriteAnimation, EnemyBase, SimpleEnemy")
- .attr({ x: Crafty.math.randomInt(20, STAGE_WIDTH), y: -50, z: 2})
+ .attr({ x: Crafty.math.randomInt(20, STAGE_WIDTH-20), y: -50, z: 2})
.animate("idle", 0, 0, 3)
.animate("death", 4, 0, 8)
.animate("idle", 20, -1)
View
BIN  imgs/bullet.png
Deleted file not rendered
View
BIN  imgs/burger.gif
Deleted file not rendered
View
BIN  imgs/burger_shoot.gif
Deleted file not rendered
Please sign in to comment.
Something went wrong with that request. Please try again.