Removed the ShadowTile and replaced it with facilities in the BaseTile to

"cover" a tile with an object tile. While a tile is covered, it is
impassable. This allows us to have base tiles under object tile footprints
that are rendered, but not traversable by character sprites.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@944 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-06 17:13:06 +00:00
parent 3042e9c2ad
commit 81ed1f42e8
5 changed files with 41 additions and 68 deletions
@@ -1,5 +1,5 @@
//
// $Id: BaseTile.java,v 1.3 2001/11/27 22:17:42 mdb Exp $
// $Id: BaseTile.java,v 1.4 2002/02/06 17:13:06 mdb Exp $
package com.threerings.miso.tile;
@@ -37,7 +37,7 @@ public class BaseTile extends Tile
*/
public boolean isPassable ()
{
return _passable;
return _passable && !_covered;
}
/**
@@ -49,6 +49,19 @@ public class BaseTile extends Tile
_passable = passable;
}
/**
* Sets whether this tile is currently covered by the footprint of an
* object tile or not. When it is covered, it can't be walked on by
* character sprites.
*/
public void setCovered (boolean covered)
{
_covered = covered;
}
/** Whether the tile is passable. */
protected boolean _passable = true;
/** Whether the tile is covered by an object tile. */
protected boolean _covered = true;
}
@@ -1,39 +0,0 @@
//
// $Id: ShadowTile.java,v 1.4 2001/11/27 22:17:42 mdb Exp $
package com.threerings.miso.tile;
import java.awt.Graphics2D;
import java.awt.Shape;
/**
* The shadow tile extends base tile to provide an always-impassable tile
* that has no display image. Shadow tiles are intended for placement in
* the footprint of {@link com.threerings.media.tile.ObjectTile} objects.
*/
public class ShadowTile extends BaseTile
{
/** The scene coordinates of the shadow tile's parent object tile. */
public int ox, oy;
/**
* Constructs a shadow tile.
*/
public ShadowTile (int x, int y)
{
super(null);
// save the coordinates of our parent object tile
ox = x;
oy = y;
// shadow tiles are always impassable
_passable = false;
}
// documentation inherited
public void paint (Graphics2D gfx, Shape dest)
{
// paint nothing as we're naught but a measly shadow of a tile
}
}