Permalink
Browse files

Add Wizard sprite in the PlayState (with mock wizard png)

  • Loading branch information...
1 parent 479e276 commit e2508ead8dcb2751d0cac05921c41fd69150158d @marioizquierdo committed Feb 6, 2012
View
Binary file not shown.
@@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
- <value>'29/01/2012'</value>
+ <value>'2/6/2012'</value>
</define>
<verbose-stacktraces>true</verbose-stacktraces>
<source-path append="true">
@@ -16,7 +16,7 @@
</define>
<define append="true">
<name>CONFIG::timeStamp</name>
- <value>'29/01/2012'</value>
+ <value>'2/6/2012'</value>
</define>
<verbose-stacktraces>true</verbose-stacktraces>
<source-path append="true">
View
@@ -9,6 +9,9 @@ package
{
add(new FlxText(0, 0, 100, "Playing wave " + Registry.currentLevel)); //adds a 100px wide text field at position 0,0 (top left)
add(new FlxText(0, FlxG.height - 32, 100, "Press space to clear this wave!"));
+
+ Registry.playerWizard = new PlayerWizard(20, 120);
+ add(Registry.playerWizard);
}
override public function update():void
View
@@ -0,0 +1,43 @@
+package
+{
+ import org.flixel.*;
+
+ public class PlayerWizard extends FlxSprite
+ {
+ [Embed(source="data/wizard.png")] protected var ImgWizard:Class;
+ public function PlayerWizard(X:int,Y:int)
+ {
+ super(X,Y);
+ loadGraphic(ImgWizard, false, false, 27, 32);
+
+ //bounding box tweaks
+ width = 27;
+ height = 32;
+ offset.x = 1;
+ offset.y = 1;
+
+ //basic player physics
+ drag.x = 300;
+ maxVelocity.x = 50;
+
+ }
+
+ override public function update():void
+ {
+
+ //MOVEMENT
+ acceleration.x = 0;
+ if(FlxG.keys.LEFT)
+ {
+ acceleration.x -= drag.x/2;
+ }
+ else if(FlxG.keys.RIGHT)
+ {
+ acceleration.x += drag.x/2;
+ }
+
+ }
+
+ }
+
+}
View
@@ -4,11 +4,11 @@ package
public class Registry
{
- //public static var player:Player;
//public static var enemies:EnemyManager;
//public static var inventory:Inventory;
//public static var spells:Spells;
+ public static var playerWizard:PlayerWizard;
public static var currentLevel:int;
public static var enemiesKilledThisLevel:int;
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e2508ea

Please sign in to comment.