Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit e2508ead8dcb2751d0cac05921c41fd69150158d 1 parent 479e276
@marioizquierdo authored
View
BIN  bin/YouShallNotPass.swf
Binary file not shown
View
2  obj/YouShallNotPassConfig.old
@@ -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
2  obj/YouShallNotPassConfig.xml
@@ -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
3  src/PlayState.as
@@ -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
43 src/PlayerWizard.as
@@ -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
2  src/Registry.as
@@ -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
BIN  src/data/wizard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.