Exit Full View

Cavern Quest 2 / src / commonMain / kotlin / constants.kt

/**
 * The size of each item in the [Grid].
 */
const val gridSize = 36f

// region == Speeds ==
// Values are in seconds (i.e. time periods, not speeds).

/**
 * The time for each animation frame.
 * Only for appearances, does not affect game-play
 */
const val playerIdleFrameTime = 0.3f

/**
 * The total time for the walking animation. Determines how fast Player can move.
 */
const val playerWalkTime = 0.15f

/**
 * The total time for [Soil] to be blasted into nothingness.
 */
const val soilBlastTime = 0.2f

/**
 * When soil is removed from under a [Rock], the rock pauses before falling.
 * This is related to [playerWalkTime] and [soilBlastTime],
 * as the player need time to walk under the rock, blast the next soil and walk again.
 *
 * i.e. [rockFallDelay] > [playerWalkTime] * 2 + [soilBlastTime].
 */
const val rockFallDelay = playerWalkTime * 2 + soilBlastTime + 0.01f

/**
 * Only for animations. Not critical for game-play.
 */
const val monsterIdleTime = 0.2f

/**
 *  Either the same, or very similar to [playerWalkTime].
 *  [Player] should not easily out-run [Monster]s.
 */
const val monsterWalkTime = playerWalkTime

// endregion == speeds ==