mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 05:54:05 +09:00
door and its ghost now spawns at the right position in the world
This commit is contained in:
@@ -66,10 +66,9 @@ class BlockMarkerActor : ActorWithBody(Actor.RenderOrder.OVERLAY, physProp = Phy
|
||||
|
||||
override fun update(delta: Float) {
|
||||
if (isVisible) {
|
||||
hitbox.setPosition(
|
||||
Terrarum.mouseTileX * TILE_SIZED,
|
||||
(Terrarum.mouseTileY - floor((hitbox.height - 0.5) / TILE_SIZED)) * TILE_SIZED
|
||||
)
|
||||
val hbx = (Terrarum.mouseTileX - floor((hitbox.width - 0.5).div(2) / TILE_SIZED)) * TILE_SIZED
|
||||
val hby = (Terrarum.mouseTileY - floor((hitbox.height - 0.5) / TILE_SIZED)) * TILE_SIZED
|
||||
hitbox.setPosition(hbx, hby)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ package net.torvald.terrarum.gameactors
|
||||
|
||||
import net.torvald.gdx.graphics.Cvec
|
||||
|
||||
/**
|
||||
* Lightbox is defined based on pixelwise position in the world!
|
||||
*/
|
||||
class Lightbox() {
|
||||
var hitbox: Hitbox = Hitbox(0.0,0.0,0.0,0.0)
|
||||
var light: Cvec = Cvec()
|
||||
|
||||
Reference in New Issue
Block a user