mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
blockprop: fall is now grav
This commit is contained in:
@@ -80,10 +80,8 @@ open class FixtureBase(blockBox0: BlockBox, val blockBoxProps: BlockBoxProps = B
|
||||
// set the position of this actor
|
||||
worldBlockPos = Point2i(posX, posY)
|
||||
|
||||
val posXoff = (TSIZE % (this.sprite?.cellWidth ?: 0)) / 2
|
||||
|
||||
this.isVisible = true
|
||||
this.hitbox.setFromWidthHeight(posX * TSIZE + posXoff, posY * TSIZE, blockBox.width * TSIZE, blockBox.height * TSIZE)
|
||||
this.hitbox.setFromWidthHeight(posX * TSIZE, posY * TSIZE, blockBox.width * TSIZE, blockBox.height * TSIZE)
|
||||
|
||||
// actually add this actor into the world
|
||||
Terrarum.ingame!!.addNewActor(this)
|
||||
|
||||
@@ -26,10 +26,10 @@ internal class FixtureTikiTorch : FixtureBase(BlockBox(BlockBox.NO_COLLISION, 1,
|
||||
init {
|
||||
density = 1200.0
|
||||
|
||||
setHitboxDimension(10, 24, 0, 0)
|
||||
setHitboxDimension(16, 32, 0, 0)
|
||||
|
||||
lightBoxList = ArrayList(1)
|
||||
lightBoxList.add(Hitbox(3.0, 0.0, 4.0, 3.0))
|
||||
lightBoxList.add(Hitbox(6.0, 5.0, 4.0, 3.0))
|
||||
|
||||
makeNewSprite(TextureRegionPack(ModMgr.getGdxFile("basegame", "sprites/fixtures/tiki_torch.tga"), 10, 27))
|
||||
sprite!!.setRowsAndFrames(1, 1)
|
||||
|
||||
@@ -254,7 +254,7 @@ object WorldSimulator {
|
||||
val tile = world.getTileFromTerrain(x, y) ?: Block.STONE
|
||||
val tileBelow = world.getTileFromTerrain(x, y + 1) ?: Block.STONE
|
||||
|
||||
if (tile.isFallable()) {
|
||||
if (tile.maxSupport()) {
|
||||
// displace fluid. This statement must precede isSolid()
|
||||
if (tileBelow.isFluid()) {
|
||||
// remove tileThis to create air pocket
|
||||
@@ -316,7 +316,7 @@ object WorldSimulator {
|
||||
}
|
||||
|
||||
|
||||
fun Int.isFallable() = BlockCodex[this].isFallable
|
||||
fun Int.isFallable() = BlockCodex[this].maxSupport
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user