Skip to content

Commit

Permalink
adding new files
Browse files Browse the repository at this point in the history
  • Loading branch information
vad710 committed Apr 21, 2012
1 parent b8a1c15 commit 1b41faf
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/Level.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package
{
/**
* ...
* @author Vinny
*/
import org.flixel.*;

public class Level extends FlxState
{
private var camera:Camera;
private var planets:FlxGroup = new FlxGroup();
private var player:Player;
private var obstacles:FlxGroup;
private var music:MusicController;

//camera options
private var cameraOrigin:FlxPoint = new FlxPoint(0, 0);
private var width:int = 960;
private var height:int = 540;
private var zoom:int = 1;


public function CreatePlanets(planets:FlxGroup) : void
{
throw Error("Please Override CreatePlanets Method");
}

override public function create():void
{
this.CreatePlanets(planets);

// create the player
player = new Player(planets.members[0], planets);

// create camera
FlxG.camera.target = player;

// start the music
music = new MusicController();

// add all to the world
add(planets);
//add(obstacles);
add(player);
}

override public function update():void
{
super.update();
if (player.getSuccess() == true)
{
//TODO: Determine what to do about win condition...
FlxG.switchState(new MenuState());
}
}
}

}
27 changes: 27 additions & 0 deletions src/levels/Level01.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package levels
{
import org.flixel.FlxGroup;
/**
* ...
* @author Vinny
*/
public class Level01 extends Level
{
override public function CreatePlanets(planets:FlxGroup):void
{
// create all the planets for the level
planets.add(new SpongePlanet(350, 350, 0.5 ,1 ));
planets.add(new LightbulbPlanet(20, 20, 0.5));
/*planets.add(new LightbulbPlanet(800, 740, 0));
planets.add(new LightbulbPlanet(400, 490, 0));
planets.add(new SpongePlanet(50, 50, 1));
planets.add(new LightbulbPlanet(100, 70, 1));
planets.add(new LightbulbPlanet(800, 740, 0));
planets.add(new LightbulbPlanet(200, 150, 0));
planets.add(new SpongePlanet(50, 500, 1));
/**/
}

}

}

0 comments on commit 1b41faf

Please sign in to comment.