Skip to content

Commit

Permalink
Fixed sponge sound
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Apr 22, 2012
1 parent f47816f commit 8238f1d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/Player.as
Expand Up @@ -13,8 +13,9 @@ package
public class Player extends FlxSprite
{

[Embed(source="../assets/drop/ALL THE SPRITES.png")]
private var player_Sprite:Class;
[Embed(source = "../assets/drop/ALL THE SPRITES.png")] private var player_Sprite:Class;
[Embed(source ="../assets/audio/checkpoint.mp3")] private var checkpoint_sound:Class;


private var planets:FlxGroup;
private var anti_gravity_flag:Boolean = false;
Expand Down Expand Up @@ -242,6 +243,7 @@ package
{
if (checkpointPlanet.x != currentCheckpoint.x)
{
FlxG.play(checkpoint_sound);
currentCheckpoint.removeWater();
currentCheckpoint = checkpointPlanet;
currentCheckpoint.addWater();
Expand Down
4 changes: 1 addition & 3 deletions src/SpongePlanet.as
Expand Up @@ -15,8 +15,7 @@ package
private var display_overlay:Boolean = false;

[Embed(source = "../assets/planets/sponge.png")] private var sponge_planet:Class;
[Embed(source = "../assets/planets/sponge-overlay-fill.png")] private var sponge_planet_overlay:Class;
[Embed(source="../assets/audio/checkpoint.mp3")] private var checkpoint_sound:Class;
[Embed(source = "../assets/planets/sponge-overlay-fill.png")] private var sponge_planet_overlay:Class;

public function SpongePlanet(x:int, y:int, scale:Number = 1, checkpoint:int = 0, mass:Number = DEFAULT_MASS)
{
Expand Down Expand Up @@ -55,7 +54,6 @@ package
override public function playerCollision(player:Player):void
{
player.reachedCheckpoint(this);
FlxG.play(checkpoint_sound);
}

public function addWater():void
Expand Down
30 changes: 29 additions & 1 deletion src/levels/LevelTutorial.as
Expand Up @@ -2,6 +2,7 @@ package levels
{
import org.flixel.FlxG;
import org.flixel.FlxGroup;
import org.flixel.FlxText;

/**
* ...
Expand All @@ -11,6 +12,33 @@ package levels
{
private const baseUnit:int = DonutPlanet.DEFAULT_SIZE / 2;

// tutorial text
private var arrowKeybinds:FlxText = new FlxText (baseUnit * 0, baseUnit * 1, 200, "Use arrow keys to move around the planet!");
private var spaceKeybind:FlxText = new FlxText (baseUnit * 0, baseUnit * -.5, 200, "Use the spacebar to jump off the planet!");
private var spongeDescription:FlxText = new FlxText (baseUnit * 5, baseUnit * -.5, 200, "Sponge planets are checkpoints. If you die, you respawn at the last sponge planet you touched");
private var donutDescription:FlxText = new FlxText (baseUnit * 3, baseUnit * -.5, 200, "Donut planets are safe to land on");
private var lightbulbDescription:FlxText = new FlxText (baseUnit * 7, baseUnit * -.5, 200, "Lightbulb planets cause you to evaporate! They send you back to the last Sponge Planet you touched");
private var goalDescription:FlxText = new FlxText (baseUnit * 10, baseUnit * -.5, 200, "Try to find and land on the goal planet, to beat the level!");

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

arrowKeybinds.setFormat(null, 20, 0xFF00FF, "center");
spaceKeybind.setFormat(null, 20, 0xFF00FF, "center");
spongeDescription.setFormat(null, 20, 0xFF00FF, "center");
donutDescription.setFormat(null, 20, 0xFF00FF, "center");
lightbulbDescription.setFormat(null, 20, 0xFF00FF, "center");
goalDescription.setFormat(null, 20, 0xFF00FF, "center");

add(arrowKeybinds);
add(spaceKeybind);
add(spongeDescription);
add(donutDescription);
add(lightbulbDescription);
add(goalDescription);
}

override public function CreatePlanets(planets:FlxGroup):void
{
// create all the planets for the level
Expand All @@ -29,7 +57,7 @@ package levels
if (player.getSuccess())
{
//TODO: Determine what to do about win condition...
FlxG.switchState(new Level03());
FlxG.switchState(new Level01());
}
}
}
Expand Down

0 comments on commit 8238f1d

Please sign in to comment.