mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 02:24:05 +09:00
conveyor wip
This commit is contained in:
@@ -6,6 +6,7 @@ import net.torvald.terrarum.*
|
|||||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZED
|
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZED
|
||||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||||
import net.torvald.terrarum.modulebasegame.worldgenerator.HALF_PI
|
import net.torvald.terrarum.modulebasegame.worldgenerator.HALF_PI
|
||||||
|
import net.torvald.terrarum.modulebasegame.worldgenerator.TWO_PI
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.*
|
import kotlin.math.*
|
||||||
|
|
||||||
@@ -81,7 +82,7 @@ class ActorConveyors : ActorWithBody {
|
|||||||
private val COL_BELT = Color(0x444444ff)
|
private val COL_BELT = Color(0x444444ff)
|
||||||
private val COL_BELT_TOP = Color(0x666666ff)
|
private val COL_BELT_TOP = Color(0x666666ff)
|
||||||
|
|
||||||
private val COL_BELT_ALT = Color(0x888888ff.toInt())
|
private val COL_BELT_ALT = Color.MAGENTA//Color(0x888888ff.toInt())
|
||||||
private val COL_BELT_TOP_ALT = Color(0xccccccff.toInt())
|
private val COL_BELT_TOP_ALT = Color(0xccccccff.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,6 +187,17 @@ class ActorConveyors : ActorWithBody {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stripes at the left spindle
|
||||||
|
// eq: k units/s on straight part == (k / r) rad/s on curve
|
||||||
|
val k = topSegRemainder + turn // TODO calculate starting angle offset
|
||||||
|
val angularOffsetStart = di + k
|
||||||
|
val segmentCount = r / segmentLen
|
||||||
|
for (i in 0 until segmentCount.toInt()) {
|
||||||
|
val a1 = angularOffsetStart + segmentLen * i
|
||||||
|
|
||||||
|
drawArcOnWorld(cx1, cy1, r, a1, segmentLen * 0.25, 2f)
|
||||||
|
}
|
||||||
|
|
||||||
it.color = COL_BELT_TOP
|
it.color = COL_BELT_TOP
|
||||||
// belt top
|
// belt top
|
||||||
drawLineOnWorld(btx1, bty1 - 0.5f, btx2, bty2 - 0.5f, 1f)
|
drawLineOnWorld(btx1, bty1 - 0.5f, btx2, bty2 - 0.5f, 1f)
|
||||||
|
|||||||
Reference in New Issue
Block a user