mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-19 06:54:05 +09:00
TilePropCodex is now object, torch flicker (WIP as all the torches are in unison)
Former-commit-id: df9c0e3a9ace2ba976da5e81f1f2d2217db541a0 Former-commit-id: 81a25a938023f318937e1f4ded15e6047fdf8864
This commit is contained in:
@@ -546,13 +546,17 @@ open class ActorWithBody constructor() : Actor(), Visible {
|
||||
if (!isNoCollideWorld){
|
||||
val delta: Vector2 = Vector2(hitbox.toVector() - nextHitbox.toVector()) // we need to traverse back, so may as well negate at the first place
|
||||
val ccdDelta = delta.setMagnitude(CCD_TICK)
|
||||
val ccdTryMax = 400
|
||||
var ccdCount = 0
|
||||
|
||||
//if (ccdDelta.x.abs() >= SLEEP_THRE || ccdDelta.y.abs() >= SLEEP_THRE) { // regular situation
|
||||
// CCD to delta while still colliding
|
||||
while (isColliding(CONTACT_AREA_LEFT) || isColliding(CONTACT_AREA_RIGHT)
|
||||
|| isColliding(CONTACT_AREA_TOP) || isColliding(CONTACT_AREA_BOTTOM)
|
||||
while ((isColliding(CONTACT_AREA_LEFT) || isColliding(CONTACT_AREA_RIGHT)
|
||||
|| isColliding(CONTACT_AREA_TOP) || isColliding(CONTACT_AREA_BOTTOM))
|
||||
&& ccdCount < ccdTryMax
|
||||
) {
|
||||
nextHitbox.translate(ccdDelta)
|
||||
ccdCount += 1
|
||||
}
|
||||
//}
|
||||
/*else { // stuck while standing still
|
||||
|
||||
@@ -33,9 +33,9 @@ object FactionCodex {
|
||||
}
|
||||
|
||||
private fun insertionSortLastElem(arr: ArrayList<Faction>) {
|
||||
var x: Faction
|
||||
val x: Faction
|
||||
var j: Int
|
||||
var index: Int = arr.size - 1
|
||||
val index: Int = arr.size - 1
|
||||
x = arr[index]
|
||||
j = index - 1
|
||||
while (j > 0 && arr[j] > x) {
|
||||
|
||||
Reference in New Issue
Block a user