Permalink
Browse files

climb tree sprite and power reorder

  • Loading branch information...
1 parent 33da4c3 commit 689e806d7ac28986dcddcb4694584005204653bf Colin Farrell committed Jan 29, 2012
Showing with 248 additions and 15 deletions.
  1. +1 −1 src/CreationSprite.as
  2. +13 −0 src/DestoryTutorialTrigger.as
  3. +112 −0 src/MapColinMap.as
  4. +88 −0 src/MapNewMap.as
  5. +14 −8 src/PlayState.as
  6. +8 −6 src/Player.as
  7. +12 −0 src/StatsRecorder.as
View
@@ -12,7 +12,7 @@ package
{
super(X, Y);
loadGraphic(ImgCreate,true,true,160, 128);
- addAnimation("create", [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14], 12, false);
+ addAnimation("create", [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14], 24, false);
}
}
@@ -0,0 +1,13 @@
+package
+{
+ public class DestoryTutorialTrigger extends TutorialTrigger
+ {
+ [Embed(source="../assets/destroyMessage.png")] protected var DesTut:Class;
+
+ public function DestoryTutorialTrigger(X:int, Y:int)
+ {
+ super(X, Y);
+ SetUpMessage(DesTut);
+ }
+ }
+}
View
@@ -0,0 +1,112 @@
+//Code generated by Flan. http://www.tbam.com.ar/utility--flan.php
+
+package {
+ import org.flixel.*;
+
+ public class MapColinMap extends MapBase {
+ //Media content declarations
+ [Embed(source="../assets/MapCSV_ColinMap_MainGame.txt", mimeType="application/octet-stream")] public var CSV_MainGame:Class;
+ [Embed(source="../assets/game_tilesheetA32wide.png")] public var Img_MainGame:Class;
+
+
+ public function MapColinMap() {
+
+ _setCustomValues();
+
+ bgColor = 0xffffffff;
+
+ layerMainGame = new FlxTilemap();
+ layerMainGame.loadMap(new CSV_MainGame, Img_MainGame,32,32);layerMainGame.x = 0;
+ layerMainGame.y = 0;
+ layerMainGame.scrollFactor.x = 1.000000;
+ layerMainGame.scrollFactor.y = 1.000000;
+
+ allLayers = [ layerMainGame ];
+
+
+ boundsMinX = 0;
+ boundsMinY = 0;
+ boundsMaxX = 1280;
+ boundsMaxY = 704;
+ }
+
+ override public function addSpritesToLayerMainGame(onAddCallback:Function = null):void {
+ var obj:FlxSprite;
+
+ obj = new Player(15, 398);;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ obj = new Tree(97, 393);;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ obj = new Exit(1224, 354);;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ obj = new Tree(345, 197);;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ }
+
+ override public function customFunction(param:* = null):* {
+
+ }
+
+ private function _setCustomValues():void {
+ }
+
+ }
+}
View
@@ -0,0 +1,88 @@
+//Code generated by Flan. http://www.tbam.com.ar/utility--flan.php
+
+package {
+ import com.adamatomic.flixel.*;
+
+ public class MapNewMap extends MapBase {
+ //Media content declarations
+ [Embed(source="MapCSV_NewMap_MainGame.txt", mimeType="application/octet-stream")] public var CSV_MainGame:Class;
+ [Embed(source="../assets/game_tilesheetA32wide.png")] public var Img_MainGame:Class;
+
+
+ public function MapNewMap() {
+
+ _setCustomValues();
+
+ bgColor = 0xffffffff;
+
+ layerMainGame = new FlxTilemap(new CSV_MainGame, Img_MainGame,1,1);
+ layerMainGame.x = 0;
+ layerMainGame.y = 0;
+ layerMainGame.scrollFactor.x = 1.000000;
+ layerMainGame.scrollFactor.y = 1.000000;
+
+ allLayers = [ layerMainGame ];
+
+
+ boundsMinX = 0;
+ boundsMinY = 0;
+ boundsMaxX = 1280;
+ boundsMaxY = 704;
+ }
+
+ override public function addSpritesToLayerMainGame(onAddCallback:Function = null):void {
+ var obj:FlxSprite;
+
+ obj = new Player(133, 239);;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ obj = new Exit(1172, 229);;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ ;
+ obj.x+=obj.offset.x;
+ obj.y+=obj.offset.y;
+ FlxG.state.add(obj);
+ if(onAddCallback != null)
+ onAddCallback(obj);
+ }
+
+ override public function customFunction(param:* = null):* {
+
+ }
+
+ private function _setCustomValues():void {
+ }
+
+ }
+}
View
@@ -465,22 +465,24 @@ package
iconDisplay=new FlxGroup();
var pUISprite:PowerUISprite=new PowerUISprite(32,FlxG.height- 260);
- pUISprite.loadGraphic(treeIcon,true,false,128,128,false);
+ pUISprite.loadGraphic(platformIconClass,true,false,128,128,false);
pUISprite.play("Idle");
iconDisplay.add(pUISprite);
+
+
pUISprite=new PowerUISprite(32,FlxG.height- 260);
- pUISprite.loadGraphic(platformIconClass,true,false,128,128,false);
+ pUISprite.loadGraphic(explodeIconClass,true,false,128,128,false);
pUISprite.play("Idle");
pUISprite.visible=false;
iconDisplay.add(pUISprite);
pUISprite=new PowerUISprite(32,FlxG.height- 260);
- pUISprite.loadGraphic(explodeIconClass,true,false,128,128,false);
+ pUISprite.loadGraphic(treeIcon,true,false,128,128,false);
pUISprite.play("Idle");
pUISprite.visible=false;
-
iconDisplay.add(pUISprite);
+
add(iconDisplay);
FlxG.mouse.show();
@@ -616,17 +618,21 @@ package
public function climbTree(p:Player, treeToClimb:Tree):void
{
- FlxG.log("Climb Tree in play state"+treeToClimb);
+
player.play("climbTree");
if (player.y > treeToClimb.y -5)
{
+ FlxG.log("this is updating y");
player.y = treeToClimb.y-64;
-
+ FlxG.log("this is updating before " + player.x);
+ player.x = treeToClimb.x+32;
+ FlxG.log("this is updating after" + player.x);
+ player.climbTree(treeToClimb);
}
//player.canClimb = true;
//player.treeToClimb = treeToClimb;
- FlxG.log("Climb Tree in play state, climbing tree"+treeToClimb);
- player.climbTree(treeToClimb);
+
+
}
public function plantTreeFirmly(tree:Tree, m:FlxTilemap):void
View
@@ -89,9 +89,11 @@ package
addAnimation("climbTree", [3,4,7,4,3], 25);
sacrifices = new Array();
- sacrifices.push("Trees");
sacrifices.push("Platforms");
sacrifices.push("Explosions");
+ sacrifices.push("Trees");
+
+
currentSacrifice = 0;
FlxG.play(spawnInSound);
@@ -499,20 +501,20 @@ package
public function climbTree(tree:Tree):void
{
keyboardInputEnabled = false;
- FlxG.log("Climbing Tree "+tree);
+ FlxG.log("playerxa " + x);
treeToClimb=tree;
treeClimbSprite=new TreeClimbSprite(0,0);
treeClimbSprite.x=treeToClimb.x;
treeClimbSprite.y=treeToClimb.y-64;
-
+ FlxG.log("playerxb " + x);
FlxG.state.add(treeClimbSprite);
//treeToClimb.visible=false;
treeClimbSprite.addAnimationCallback(treeAnimationDone);
this.visible=false;
treeClimbSprite.play("Climb");
-
+ FlxG.log("playerxc " + x);
//Comment out put back in animation is feckered
//play("climbTree");
@@ -536,10 +538,10 @@ package
//treeToClimb.visible=true;
- y = treeToClimb.y - this.height - 20 ;
+ // y = treeToClimb.y - this.height - 20 ;
// treeToClimb.y;
-
+ x = x + 32;
treeClimbSprite.visible=false;
this.visible=true;
FlxG.state.remove(treeClimbSprite);
View
@@ -0,0 +1,12 @@
+package
+{
+ public class StatsRecorder
+ {
+ private var
+
+
+ public function StatsRecorder()
+ {
+ }
+ }
+}

0 comments on commit 689e806

Please sign in to comment.