-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
/**/ | ||
} | ||
|
||
} | ||
|
||
} |