mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
dunno why but setting camera position to negative works...
This commit is contained in:
@@ -14,7 +14,7 @@ class Hitbox(x1: Double, y1: Double, width: Double, height: Double) {
|
||||
|
||||
@Volatile var hitboxStart: Point2d
|
||||
private set
|
||||
val hitboxEnd: Point2d
|
||||
inline val hitboxEnd: Point2d
|
||||
get() = Point2d(hitboxStart.x + width, hitboxStart.y + height)
|
||||
var width: Double = 0.0
|
||||
private set
|
||||
@@ -135,4 +135,8 @@ class Hitbox(x1: Double, y1: Double, width: Double, height: Double) {
|
||||
operator fun minus(other: Hitbox): Vector2 {
|
||||
return Vector2(other.centeredX - this.centeredX, other.centeredY - this.centeredY)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return this.hitboxStart == (other as Hitbox).hitboxStart && this.hitboxEnd == (other as Hitbox).hitboxEnd
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
import net.torvald.terrarum.worlddrawer.LightmapRenderer
|
||||
|
||||
/**
|
||||
* A wrapper to support instant player changing (or possessing other NPCs maybe)
|
||||
*
|
||||
@@ -13,4 +15,17 @@ class PlayableActorDelegate(val actor: ActorHumanoid) {
|
||||
throw IllegalArgumentException("Player must be 'Controllable'!")
|
||||
}
|
||||
|
||||
|
||||
fun update(delta: Float) {
|
||||
//val oldTilewisePos = actor.tilewiseHitbox
|
||||
|
||||
actor.update(delta)
|
||||
|
||||
// fire lightmap recalculate event upon tilewise pos change
|
||||
//val newTilewisePos = actor.tilewiseHitbox
|
||||
//if (oldTilewisePos != newTilewisePos) {
|
||||
// LightmapRenderer.fireRecalculateEvent()
|
||||
//}
|
||||
// not going to work: think about stationery tiki torches, global lights, etc
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ object PlayerBuilderSigrid {
|
||||
p.actorValue[AVKey.SPEEDBUFF] = 1.0
|
||||
p.actorValue[AVKey.ACCEL] = ActorHumanoid.WALK_ACCEL_BASE
|
||||
p.actorValue[AVKey.ACCELBUFF] = 1.0
|
||||
p.actorValue[AVKey.JUMPPOWER] = 9.0
|
||||
p.actorValue[AVKey.JUMPPOWER] = 8.0
|
||||
|
||||
p.actorValue[AVKey.BASEMASS] = 80.0
|
||||
p.actorValue[AVKey.SCALEBUFF] = 1.0 // Constant 1.0 for player, meant to be used by random mobs
|
||||
|
||||
Reference in New Issue
Block a user