Skip to content

Commit

Permalink
re-add shells
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbraun committed May 8, 2012
1 parent 05029b5 commit 6352ca4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
13 changes: 0 additions & 13 deletions Egg.as
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ package {

protected static var eatenGraphics:Array = [EatenEggBlanc, EatenEggA, EatenEggB, EatenEggC];
protected static var eggGraphics:Array = [EggBlanc, EggA, EggB, null, EggRotten]
protected static var shellGraphics:Array = [ShellB, ShellB, ShellB, ShellB, ShellB];

public static const ROTTEN:uint = 4;

protected var _points:int;
protected var _eggType:int;
// protected var _shells:AxEmitter;

public function Egg(eggType:int = 0, x:int = 0, y:int = 0 ){
super(x, y);
Expand All @@ -40,26 +38,15 @@ package {
offset.y = 6;
offset.x = 1;

//_shells = new FlxEmitter();
//_shells.makeParticles(shellGraphics[eggType], 4);

_points = 2; // Can be switched later by eggType

}

/*
public function get shells():FlxEmitter{
return _shells;
}
*/

public function eat():void{
offset.y = 0;
offset.x = 0;
load(eatenGraphics[_eggType]);
show(0);
// X-Tina style
dirty = true;
}

public function get points():int{
Expand Down
26 changes: 16 additions & 10 deletions LevelState.as
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package {
import org.axgl.*;
import org.axgl.text.*;
import org.axgl.particle.*;
import org.axgl.render.*;
import org.axgl.util.*;

public class LevelState extends AxState {
[Embed(source='assets/SnakeSounds/schluck2tiefer.mp3')] protected var BiteSound:Class;
[Embed(source='assets/SnakeSounds/bup.mp3')] protected var Bup:Class;
[Embed(source='assets/images/shell.png')] protected static var Shell:Class;

/*
protected var _biteSound:FlxSound;
Expand All @@ -30,21 +34,21 @@ package {
protected var _timerHud:String;

protected var _switchLevel:SwitchLevel;
protected var _particles:AxGroup;

override public function create():void {
super.create();

//FlxG.log("Starting game");

/*
_bup = new FlxSound;
_bup.loadEmbedded(Bup);
_particles = new AxGroup();
var effect:AxParticleEffect = new AxParticleEffect('eat-egg', Shell, 5);
effect.xVelocity = new AxRange(-70, 70);
effect.yVelocity = new AxRange(-70, 70);
effect.lifetime = new AxRange(0.5, 1.5);
effect.amount = 4;
effect.blend = AxBlendMode.PARTICLE;
effect.color(new AxColor(0.3, 0.3, 0.3), new AxColor(1, 1, 1), new AxColor(0.3, 0.3, 0.3), new AxColor(1, 1, 1));
_particles.add(AxParticleSystem.register(effect));

_biteSound = new FlxSound;
_biteSound.loadEmbedded(BiteSound);
FlxG.mouse.hide();
*/
_score = 0;
_snake = new Snake(8);
_food = new AxGroup();
Expand All @@ -66,6 +70,7 @@ package {
spawnFoods(3);
add(_snake);
add(_food);
add(_particles);
add(_bonusBar);
addHud();
}
Expand Down Expand Up @@ -210,6 +215,7 @@ package {
shells.start(true, 3);
add(shells);
*/
AxParticleSystem.emit("eat-egg", snakeHead.x, snakeHead.y);

_food.remove(egg);

Expand Down

0 comments on commit 6352ca4

Please sign in to comment.