Skip to content

Commit

Permalink
explode changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidFarrell committed Jan 29, 2012
1 parent 3860bb5 commit a53fb69
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
47 changes: 47 additions & 0 deletions src/Explode.as
@@ -0,0 +1,47 @@
package
{
import org.flixel.*;

public class Explode extends FlxSprite
{
[Embed(source="../assets/char_explode150.png")] protected var ImgExplode:Class;


public function Explode(X:Number=0, Y:Number=0)
{
super(X, Y);
loadGraphic(ImgExplode,true,true,150, 150);
//this.alpha = 0.4;

//bounding box tweaks
// width = 32;
// height = 128;
// offset.x = 1;
// offset.y = 1;

//immovable = true;

acceleration.y = 00;



//animations
addAnimation("grow", [0, 1, 2, 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49], 24, false);


//add collisionalble canopy, add to groups in playState
/*canopy =new FlxSprite(X+10,Y-5);
canopy.width = 32;
canopy.height = 5;
canopy.immovable = true;
(FlxG.state as PlayState).canopies.add(canopy);*/

}

public override function kill():void
{
//canopy.kill();
super.kill();
}
}
}
6 changes: 4 additions & 2 deletions src/PlayState.as
Expand Up @@ -304,12 +304,14 @@ package

//map=new MapMainMap();

map=new TutorialOne();
map=new MapDavidMap();
levels.push(map);

map=new MapDavidMap();
map=new TutorialOne();
levels.push(map);





OnStartLevel();
Expand Down
8 changes: 7 additions & 1 deletion src/Player.as
Expand Up @@ -291,7 +291,7 @@ package
} else if ( sacrifices[currentSacrifice] == "Explosions") {
if ( explosionsLeft > 0 ) {
explosionsLeft--;
explode(4);
explode(3);

FlxG.camera.shake(0.005,0.35);
FlxG.camera.flash(0xffd8eba2,0.35);
Expand Down Expand Up @@ -350,6 +350,12 @@ package

public function explode(diameter:int):void
{
var explosion:Explode;
explosion = new Explode((x-59), (y-43));
FlxG.state.add(explosion);
kill();
explosion.play("grow");

_map.setTile(x / tileSize, (y / tileSize) + 1, EMPTY_TILE);

for (var i:int = 1; i < diameter; i++)
Expand Down

0 comments on commit a53fb69

Please sign in to comment.