mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
another wip
This commit is contained in:
@@ -866,7 +866,6 @@ object IngameRenderer : Disposable {
|
||||
}
|
||||
|
||||
private val bodyFriction = BlockCodex[Block.AIR].friction.frictionToMult()
|
||||
private val bodyViscosity = FluidCodex[Block.AIR].viscosity.viscosityToMult()
|
||||
|
||||
|
||||
private fun applyGravitation(gravitation: Vector2, hitboxWidth: Double) {
|
||||
@@ -877,8 +876,7 @@ object IngameRenderer : Disposable {
|
||||
private fun Int.viscosityToMult(): Double = 16.0 / (16.0 + this)
|
||||
|
||||
private fun applyForce(acc: Vector2) {
|
||||
val speedMultByTile = bodyViscosity
|
||||
externalV += acc * speedMultByTile
|
||||
externalV += acc
|
||||
}
|
||||
|
||||
private fun getDrag(externalForce: Vector2, gravitation: Vector2, hitboxWidth: Double): Vector2 {
|
||||
|
||||
@@ -499,7 +499,7 @@ open class ActorHumanoid : ActorWithBody, Controllable, Pocketed, Factionable, L
|
||||
else {
|
||||
isWalkingH = true
|
||||
|
||||
readonly_totalX =
|
||||
readonly_totalX = speedMultByTile *
|
||||
if (absAxisVal == AXIS_KEYBOARD)
|
||||
avAcceleration * applyVelo(walkCounterX) * (if (left) -1f else 1f)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user