if (angleDiff - shipInstance.movement.turnAngle > EPSILON) return GameEvent.InvalidAction("Illegal move - turn angle is too big")
val maxMoveSpeed = shipInstance.movement.moveSpeed
- val minMoveSpeed = maxMoveSpeed * (angleDiff / shipInstance.movement.turnAngle) / 2
+ val minMoveSpeed = if (maxMoveSpeed < EPSILON) maxMoveSpeed else (maxMoveSpeed * (angleDiff / shipInstance.movement.turnAngle) / 2)
val moveFrom = moveOrigin + (newFacingNormal * minMoveSpeed)
val moveTo = moveOrigin + (newFacingNormal * maxMoveSpeed)
object AITesting {
@JvmStatic
fun main(args: Array<String>) {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
+ UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel")
val instinctVectorCounts = listOf(5, 11, 17)
val instinctVectorOptions = instinctVectorCounts.map { it.toString() }.toTypedArray()