tiles won't place to the position where occupied by actors

Former-commit-id: 745558470933aea8d1f03da30ca5042a82c69eac
Former-commit-id: 09e741f5eaec3eb18b8a76c82fcc2aa62378e82e
This commit is contained in:
Song Minjae
2016-12-16 23:57:46 +09:00
parent 174a0f9101
commit d179d090c5
2 changed files with 17 additions and 2 deletions

View File

@@ -44,6 +44,14 @@ open class ActorWithBody : Actor() {
val hitbox = Hitbox(0.0, 0.0, 0.0, 0.0) // Hitbox is implemented using Double;
@Transient val nextHitbox = Hitbox(0.0, 0.0, 0.0, 0.0) // 52 mantissas ought to be enough for anybody...
val tilewiseHitbox: Hitbox
get() = Hitbox.fromTwoPoints(
hitbox.posX.div(TILE_SIZE).floor(),
hitbox.posY.div(TILE_SIZE).floor(),
hitbox.endPointX.div(TILE_SIZE).floor(),
hitbox.endPointY.div(TILE_SIZE).floor()
)
/**
* Velocity vector for newtonian sim.
* Acceleration: used in code like: