Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bmac/pocket-universe
Browse files Browse the repository at this point in the history
  • Loading branch information
JayArrrgh committed Apr 22, 2012
2 parents 3ad3d9e + 5b92315 commit 6ce056e
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 8 deletions.
16 changes: 13 additions & 3 deletions src/GrapePlanet.as
@@ -1,23 +1,33 @@
package
{
import org.flixel.FlxPoint;

/**
* ...
* @author
*/
public class GrapePlanet extends Planet
{
public const GRAPE_MASS:int = 1;

public static const DEFAULT_MASS:int = 6;
public static const DEFAULT_SIZE:int = 148;

private var planet_background:PlanetBackground;

[Embed(source = "../assets/planets/grape-planet.png")] private var grape_planet:Class;
[Embed(source = "../assets/planets/grapesbackground.png")] private var grape_background:Class;

public function GrapePlanet(x:int, y:int, checkpoint:int)
public function GrapePlanet(x:int, y:int, scale:Number=1 ,checkpoint:int=0, mass:Number=DEFAULT_MASS)
{
super(x, y, checkpoint);
this.planetMass = mass;
this.checkpoint = 0;
this.loadGraphic(grape_planet);
planet_background = new PlanetBackground(this.x, this.y, grape_background);
this.planetMass = GRAPE_MASS;

this.setSize (DEFAULT_SIZE * scale);
this.scale = new FlxPoint(scale, scale);
planet_background.scale = new FlxPoint(scale, scale);

}

Expand Down
13 changes: 12 additions & 1 deletion src/MenuState.as
Expand Up @@ -12,6 +12,7 @@ package
private var level1Button:FlxButton;
private var level2Button:FlxButton;
private var level3Button:FlxButton;
private var level4Button:FlxButton;

private var devTutorialButton:FlxButton;
private var devLevel1Button:FlxButton;
Expand Down Expand Up @@ -41,11 +42,15 @@ package
level3Button = new FlxButton(0, 60, "Level 3", startLevel3);
add(level3Button);
level4Button = new FlxButton(0, 60, "Level 4", startLevel4);
add(level4Button);
devTutorialButton = new FlxButton(100, 0, "Dev Tutorial", devLevelTutorial);
add(devTutorialButton);
devLevel1Button = new FlxButton(100, 20, "Dev Level 1", devLevel01);
add(devLevel1Button);
devLevel2Button = new FlxButton(100, 40, "Dev Level 2", devLevel02);
Expand Down Expand Up @@ -111,6 +116,12 @@ package
FlxG.switchState(new Level03);
}


private function startLevel4():void
{
FlxG.mouse.hide();
FlxG.switchState(new Level04);
}
private function devLevelTutorial():void
{
FlxG.mouse.hide();
Expand Down
47 changes: 47 additions & 0 deletions src/levels/Level04.as
@@ -0,0 +1,47 @@
package levels
{
import org.flixel.FlxG;
import org.flixel.FlxGroup;

/**
* ...
* @author Vinny
*/
public class Level04 extends Level
{

override public function CreatePlanets(planets:FlxGroup):void
{
planets.add(new SpongePlanet(50, 50, 0.5, 1));
planets.add(new GrapePlanet(550, 550, 1.5));

planets.add(new LightbulbPlanet(550, 95, .75,0, 15));
planets.add(new LightbulbPlanet(95, 550, .75, 0, 15));
planets.add(new LightbulbPlanet(550, 1005, .75,0, 15));


//little lightbulbs (top row)
planets.add(new LightbulbPlanet(750, 420, .25, 0, 0.5));
planets.add(new LightbulbPlanet(850, 420, .25, 0, 0.5));
planets.add(new LightbulbPlanet(950, 420, .25, 0, 0.5));
planets.add(new LightbulbPlanet(1050, 420, .25, 0, 0.5));

//little lightbulbs (bottom row)
planets.add(new LightbulbPlanet(750, 620, .25, 0, 0.5));
planets.add(new LightbulbPlanet(850, 620, .25, 0, 0.5));
planets.add(new LightbulbPlanet(950, 620, .25, 0, 0.5));
planets.add(new LightbulbPlanet(1050, 620, .25, 0, 0.5));


planets.add(new DonutPlanet(1375, 520, .75,0,20));

planets.add(new LightbulbPlanet(1375, 900, .75));
planets.add(new GrapePlanet(1575, 1500, 1.5));


planets.add(new HomePlanet(2000, 2000, 0.5));
}

}

}
8 changes: 4 additions & 4 deletions src/levels/LevelTutorial.as
Expand Up @@ -13,12 +13,12 @@ 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 arrowKeybinds:FlxText = new FlxText (baseUnit * 0, baseUnit * -.5, 200, "Use arrow keys to move around the planet!");
private var spaceKeybind:FlxText = new FlxText (baseUnit * 1.5,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!");
private var goalDescription:FlxText = new FlxText (baseUnit * 10, baseUnit * -.5, 200, "Try to find and land on the pond planet, to beat the level!");

override public function create():void
{
Expand Down Expand Up @@ -49,7 +49,7 @@ package levels
planets.add(new LightbulbPlanet (baseUnit * 8, baseUnit * .5, .75, 0, 0.5)); //03
planets.add(new DonutPlanet (baseUnit * 7, baseUnit * 3, .75, 0)); //04
planets.add(new DonutPlanet (baseUnit * 7, baseUnit * -2, .75, 0)); //05
planets.add(new HomePlanet (baseUnit * 10, baseUnit * 0, 1, 0, 1.25)); //06 //15
planets.add(new HomePlanet (baseUnit * 10, baseUnit * 0, .75, 0, 1.25)); //06 //15
}
override public function update():void
{
Expand Down

0 comments on commit 6ce056e

Please sign in to comment.