new block: scaffolding (does not fall yet)

This commit is contained in:
minjaesong
2019-06-10 01:40:10 +09:00
parent 6e0fe95e76
commit fd9d36c7ac
4 changed files with 15 additions and 13 deletions

View File

@@ -1365,25 +1365,17 @@ open class ActorWBMovable(renderOrder: RenderOrder, val immobileBody: Boolean =
if (KeyToggler.isOn(Input.Keys.F9)) {
val blockMark = AppLoader.resourcePool.getAsTextureRegionPack("blockmarkings_common").get(0, 0)
batch.color = Color.MAGENTA
for (y in 0 until intTilewiseHitbox.height.toInt()) {
for (x in 0 until intTilewiseHitbox.width.toInt()) {
batch.color = HITBOX_COLOURS[0]
for (y in 0..intTilewiseHitbox.height.toInt()) {
for (x in 0..intTilewiseHitbox.width.toInt()) {
batch.draw(blockMark,
(intTilewiseHitbox.startX.toFloat() + x) * TILE_SIZEF,
(intTilewiseHitbox.startY.toFloat() * y) * TILE_SIZEF
(intTilewiseHitbox.startY.toFloat() + y) * TILE_SIZEF
)
}
}
batch.color = Color.YELLOW
for (y in 0 until hIntTilewiseHitbox.height.toInt()) {
for (x in 0 until hIntTilewiseHitbox.width.toInt()) {
batch.draw(blockMark,
(hIntTilewiseHitbox.startX.toFloat() + x) * TILE_SIZEF,
(hIntTilewiseHitbox.startY.toFloat() * y) * TILE_SIZEF
)
}
}
//println(intTilewiseHitbox)
}
}
@@ -1653,6 +1645,8 @@ open class ActorWBMovable(renderOrder: RenderOrder, val immobileBody: Boolean =
private fun clampCeil(x: Double, ceil: Double): Double {
return if (Math.abs(x) > ceil) ceil else x
}
@Transient private val HITBOX_COLOURS = arrayOf(Color(0xFF00FF88.toInt()), Color(0xFFFF0088.toInt()))
}
// gameplay-related actorvalue macros

View File

@@ -28,6 +28,7 @@ object BlockBase {
// check for collision with actors (BLOCK only)
// FIXME properly fix the collision detection: it OVERRIDES the tiki-torches which should not happen AT ALL
// FIXME (h)IntTilewiseHitbox is badly defined
// FIXME actually it's this code: not recognising hitbox's starting point correctly. Use F9 for visualisation
if (gameItem.inventoryCategory == GameItem.Category.BLOCK) {
var ret1 = true
ingame.actorContainerActive.forEach {