Skip to content

Commit af40927

Browse files
committed
deleted trace
1 parent e667931 commit af40927

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Block.as

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package
1010
public var maxActionTimer:Number = 0.5;
1111
public var allBlocks:FlxGroup = new FlxGroup();
1212
public var ceiling:Block = null;
13-
public var maxTowerHeight:Number = 3;
13+
public var maxTowerHeight:Number = 7;
1414
public var flavor:String = null;
1515

1616
public function Block(X:Number=0, Y:Number=0, SimpleGraphic:Class=null)

src/Player.as

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ package
2525
public function facingRight():Boolean {return facing == RIGHT;}
2626

2727
public function steadyFall():void {move(0,0.5);}
28+
29+
public function hasLanded():Boolean {return !canMove(0,frameHeight/2);}
2830

29-
public function jump():void {move(0,-0.5);}
31+
public function jump():void {block = null; move(0,-0.5);}
3032

3133
public function isCrushed():Boolean
3234
{
@@ -67,7 +69,9 @@ package
6769

6870
// Is the player holding a block? If so it should move with the player.
6971
// (Note that moving a block moves all blocks above it)
70-
if (block != null)
72+
// (If the block grabbed is falling, the player should not be able to move it left or right)
73+
// (The player can, however, jump from tower to tower)
74+
if (block != null && (dx == 0 || block.hasLanded() || hasLanded()))
7175
{
7276
// Is the player pushing?
7377
// (Also must check if the block above can move, if it exists
@@ -181,7 +185,8 @@ package
181185
actionTimer = 0;
182186

183187
// Jump?
184-
if (!canMove(0,frameHeight/2) && FlxG.keys.justPressed("SPACE"))
188+
// (Able to jump if the player cannot fall or is clinding to a block, like wall jumping)
189+
if ((!canMove(0,frameHeight/2) || block != null) && FlxG.keys.justPressed("SPACE"))
185190
{
186191
// Yes, jump
187192
// (The Jump height tracks motion in the total dy of the jump)

0 commit comments

Comments
 (0)