Permalink
Browse files

explode changes

  • Loading branch information...
1 parent 3860bb5 commit a53fb69611d481df8d88fe4f05b0cfa2069bcf67 @DavidFarrell DavidFarrell committed Jan 29, 2012
Showing with 58 additions and 3 deletions.
  1. +47 −0 src/Explode.as
  2. +4 −2 src/PlayState.as
  3. +7 −1 src/Player.as
View
@@ -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();
+ }
+ }
+}
View
@@ -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();
View
@@ -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);
@@ -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++)

0 comments on commit a53fb69

Please sign in to comment.