fourth purple wire because four-colour theorem

This commit is contained in:
minjaesong
2024-03-13 23:45:10 +09:00
parent 2abc8b19b9
commit 6abb6f84ef
13 changed files with 41 additions and 19 deletions

View File

@@ -19,6 +19,7 @@ import org.dyn4j.geometry.Vector2
import java.lang.Math.pow
import kotlin.math.cosh
import kotlin.math.min
import kotlin.math.pow
import kotlin.math.roundToInt
/**
@@ -519,7 +520,7 @@ object WorldSimulator {
}
private fun calculateDecay(signal: Vector2, dist: Int, wire: ItemID, signalType: WireEmissionType): Vector2 {
return signal * pow(0.99, dist.toDouble())
return signal * 0.995.pow(dist.toDouble())
}
private fun traverseWireGraph(world: GameWorld, wire: ItemID, startingPoint: WireGraphCursor, signal: Vector2, signalType: WireEmissionType) {

View File

@@ -49,9 +49,9 @@ open class Electric : FixtureBase {
}
companion object {
const val ELECTRIC_THRESHOLD_HIGH = 0.9
const val ELECTRIC_THRESHOLD_LOW = 0.1
const val ELECTRIC_THRESHOLD_EDGE_DELTA = 0.7
const val ELECTRIC_THRESHOLD_HIGH = 0.6666666666666666
const val ELECTRIC_THRESHOLD_LOW = 0.3333333333333333
const val ELECTRIC_THRESHOLD_EDGE_DELTA = 0.33333333333333337
}
fun getWireEmitterAt(blockBoxIndex: BlockBoxIndex) = this.wireEmitterTypes[blockBoxIndex]