Sigh, instead let's try giving each drop sprite only two "pop-ups".
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2928 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DropBlockSprite.java,v 1.1 2003/11/26 01:42:34 mdb Exp $
|
||||
// $Id: DropBlockSprite.java,v 1.2 2003/12/31 01:26:23 ray Exp $
|
||||
|
||||
package com.threerings.puzzle.drop.client;
|
||||
|
||||
@@ -160,6 +160,22 @@ public class DropBlockSprite extends DropSprite
|
||||
buf.append(", ecol=").append(_ecol);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can this sprite pop-up a row on a forgiving rotation?
|
||||
*/
|
||||
public boolean canPopup ()
|
||||
{
|
||||
return (_popups > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called if we pop up to decrement the remaining popups we have.
|
||||
*/
|
||||
public void didPopup ()
|
||||
{
|
||||
_popups--;
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-calculates the external piece position and bounds of the drop
|
||||
* block.
|
||||
@@ -223,6 +239,10 @@ public class DropBlockSprite extends DropSprite
|
||||
}
|
||||
}
|
||||
|
||||
/** How many times this sprite can be popped-up a row in a forgiving
|
||||
* rotation. */
|
||||
protected byte _popups = 2;
|
||||
|
||||
/** The drop block bounds in board coordinates. */
|
||||
protected Rectangle _dbounds = new Rectangle();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: DropControllerDelegate.java,v 1.1 2003/11/26 01:42:34 mdb Exp $
|
||||
// $Id: DropControllerDelegate.java,v 1.2 2003/12/31 01:26:23 ray Exp $
|
||||
|
||||
package com.threerings.puzzle.drop.client;
|
||||
|
||||
@@ -374,7 +374,7 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
|
||||
// get the drop block position resulting from the rotation
|
||||
int[] info = _dboard.getForgivingRotation(
|
||||
rows, cols, _blocksprite.getOrientation(), dir,
|
||||
getRotationType(), pctdone);
|
||||
getRotationType(), pctdone, _blocksprite.canPopup());
|
||||
if (info != null) {
|
||||
// Log.info("Found valid rotation " +
|
||||
// "[orient=" + DirectionUtil.toShortString(info[0]) +
|
||||
@@ -387,6 +387,10 @@ public abstract class DropControllerDelegate extends PuzzleControllerDelegate
|
||||
// place the block in its newly rotated location
|
||||
_blocksprite.setBoardLocation(info[2], info[1]);
|
||||
|
||||
if (info[3] != 0) {
|
||||
_blocksprite.didPopup();
|
||||
}
|
||||
|
||||
// let derived classes do what they will
|
||||
blockDidRotate(dir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user