Permalink
Browse files

updated sprite sheet

  • Loading branch information...
bmac committed Apr 22, 2012
2 parents 60814ff + 18e5182 commit 831d73ed9204903f4e66833668d5cbbf33493841
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,5 +1,6 @@
package
{
+ import org.flixel.FlxPoint;
/**
* ...
* @author Chris
@@ -12,12 +13,15 @@ package
[Embed(source = "../assets/planets/doughnut.png")] private var donut_planet:Class;
- public function DonutPlanet(x:int, y:int, checkpoint:int)
+ public function DonutPlanet(x:int, y:int, scale:Number=1 ,checkpoint:int=0)
{
super(x, y, checkpoint);
this.planetMass = DONUT_MASS;
this.checkpoint = 0;
this.loadGraphic(donut_planet);
+
+ this.setSize (352 * scale);
+ this.scale = new FlxPoint(scale,scale);
}
}
View
@@ -23,7 +23,8 @@ package
this.addAnimation("Flash", [0, 1, 2, 3, 2, 1], 1, true);
planet_background = new PlanetBackground(this.x, this.y, lightbulb_background);
this.planetMass = LIGHTBULB_MASS;
- this.setSize (528 * scale);
+ this.setSize (330 * scale);
+
this.scale = new FlxPoint(scale, scale);
planet_background.scale = new FlxPoint(scale, scale);
this.checkpoint = checkpoint;
View
@@ -59,7 +59,8 @@ package
if ((angle <= 0) || (angle > 360))
{
- throw new ArgumentError("Position is out of bounds. Must be within 1-360");
+ angle = 360;
+ //throw new ArgumentError("Position is out of bounds. Must be within 1-360");
}
var point:FlxPoint = new FlxPoint();
@@ -81,7 +82,7 @@ package
{
//Height adjustment to make the object appear ontop of the planet... also adjusts for any gaps on the sprite
- var heightAdjustment:int = (gameObject.height / 2) - 8;
+ var heightAdjustment:int = (gameObject.height / 2) - 50;
//newPosition is relative to the planet's origin
var newPosition:FlxPoint = this.getPointAt(gameObject.getLocationOnPlanet(), heightAdjustment);
View
@@ -49,13 +49,15 @@ package
{
this.planets = planets;
currentCheckpoint = firstPlanet;
- //_locationOnPlanet = currentCheckpoint.getCheckpoint()
- //firstPlanet.PlaceOnPlanet(this);
- this.loadGraphic(player_Sprite, true, true, 60, 50);
+ _locationOnPlanet = currentCheckpoint.getCheckpoint()
+ this._currentPlanet = firstPlanet ;
+ this.loadGraphic(player_Sprite, true, true, 150, 150);
this.addAnimation('jump', [1, 2, 3], 6, false);
- this.addAnimation('crawl', [5, 6, 7, 8, 9], 6, false);
+ this.addAnimation('stand', [0], 6, false);
+ this.addAnimation('crawl', [4, 5, 6, 7, 8, 0], 6, false);
this.addAnimation('die', [9, 10, 11, 12, 13, 14], 6, false);
this.addAnimation('splash', [15, 16, 17, 18, 19, 20, 21, 22, 23], 6, false);
+ firstPlanet.PlaceOnPlanet(this);
}
override public function update():void
@@ -75,6 +77,7 @@ package
public function do_input():void
{
+ //this.play("stand");
if (!this.getIsWalking()) //Player already landed on a planet
{
//player is floating around, check to see if he has landed on a planet
@@ -88,6 +91,7 @@ package
if (FlxG.overlap(this, planet))
{
_currentPlanet = planet;
+ _locationOnPlanet = 1;
break;
}
}
@@ -244,6 +248,9 @@ package
public function getLocationOnPlanet():int
{
+ if (_locationOnPlanet == 0)
+ return 360;
+
return _locationOnPlanet;
}
@@ -257,20 +264,6 @@ package
_locationOnPlanet = location;
}
- /*/ change player to frozen
- public function freeze():void
- {
- // change animation to frozen
- this.frozen = true;
- timer.start(10, 1, this.defrost);
- }
-
- // defrosts player
- public function defrost():void
- {
- // return animation to normal
- this.frozen = false;
- }*/
public function is_on_planet():Boolean
{
@@ -288,7 +281,7 @@ package
public function getRadii():Number
{
- return height / 2;
+ return 20;
}
//Returns the center of this Circle in the world
View
@@ -20,7 +20,8 @@ package
this.loadGraphic(sponge_planet);
this.planetMass = SPONGE_MASS;
this.setSize (528 * scale);
- this.scale = new FlxPoint(scale,scale);
+ this.scale = new FlxPoint(scale, scale);
+ this.checkpoint = checkpoint;
}
override public function playerCollision(player:Player):void
View
@@ -11,8 +11,8 @@ package levels
{
// 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 DonutPlanet(500, 500, 1));
+ planets.add(new LightbulbPlanet(20, 20, .75));
+ planets.add(new DonutPlanet(800, 800, 1));
/*planets.add(new LightbulbPlanet(800, 740, 0));
planets.add(new LightbulbPlanet(400, 490, 0));
planets.add(new SpongePlanet(50, 50, 1));

0 comments on commit 831d73e

Please sign in to comment.