sprites can be rendered across the world seam

This commit is contained in:
minjaesong
2021-09-17 22:54:55 +09:00
parent 58be058b86
commit 575ed4410b
47 changed files with 150 additions and 166 deletions

View File

@@ -38,26 +38,26 @@ object PickaxeCore {
// return false if hitting actors
// ** below is commented out -- don't make actors obstruct the way of digging **
/*var ret1 = true
Terrarum.ingame!!.actorContainerActive.forEach {
INGAME.actorContainerActive.forEach {
if (it is ActorWBMovable && it.hIntTilewiseHitbox.intersects(mousePoint))
ret1 = false // return is not allowed here
}
if (!ret1) return ret1*/
// return false if here's no tile
if (Block.AIR == (Terrarum.ingame!!.world).getTileFromTerrain(mouseTileX, mouseTileY))
if (Block.AIR == (INGAME.world).getTileFromTerrain(mouseTileX, mouseTileY))
return false
// filter passed, do the job
val swingDmgToFrameDmg = delta.toDouble() / actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
(Terrarum.ingame!!.world).inflictTerrainDamage(
(INGAME.world).inflictTerrainDamage(
mouseTileX, mouseTileY,
Calculate.pickaxePower(player, item.material) * swingDmgToFrameDmg
)?.let { tileBroken ->
val drop = BlockCodex[tileBroken].drop
if (drop.isNotBlank()) {
Terrarum.ingame!!.addNewActor(DroppedItem(drop, mouseTileX * TILE_SIZE, mouseTileY * TILE_SIZE))
INGAME.addNewActor(DroppedItem(drop, mouseTileX * TILE_SIZE, mouseTileY * TILE_SIZE))
}
}