Skip to content

klyph 1.1.0: Movement, jumps and floors

Choose a tag to compare

@inemtsev inemtsev released this 10 Nov 15:26
· 61 commits to main since this release
02041a7

klyph 1.1.0: Movement, jumps and floors. Add it to a game with

plugins { id("com.eventslooped.klyph") version "1.1.0" }
klyph { entryPoint = "mygame.main" }
kotlin { sourceSets.nativeMain.dependencies { implementation("com.eventslooped.klyph:klyph:1.1.0") } }

or start from klyph-template. The guide and API reference are at https://inemtsev.github.io/klyph/.

Movement, jumps and floors: the engine moves your entities and stops them at walls and floors,
so a platformer takes as little code as a shooter.

Added

  • Solid: makes a box Collider a wall or floor, or a one-way ledge with Passable.FROM_BELOW.
  • KinematicBody(dx, dy): moved by the engine each fixed step and stopped at solids, reporting
    isOnFloor, isOnWall, isOnCeiling, floorOrNull and hasLanded, with dropThrough() for
    ledges. Gravity and jumps stay game code; see the
    Platformers guide.
  • Sweeps against solids: Collisions.sweepBox, sweepBoxTo, sweepCollider and floorBelowOrNull.
  • Planning a move without a body: Collisions.slideBox and slideCollider, into a reusable BoxSlide.
  • Velocity(dx, dy): applied to the entity's Transform each fixed step.
  • ParticleEmitter.burst(region, count, ...) and Commands.spawnBurst(x, y, emitter) for one-shot effects.
  • Animation.speed and SpriteAnimation.speed: a playback rate multiplier.
  • Collider.scalesWithTransform: set to false to keep the hitbox at scale 1 while the sprite squashes or spins.
  • Time.fixedStepCount.
  • Gradle plugin: com.eventslooped.klyph.library for a game's shared module, read-only klyph { }
    members hostTarget, supportedTargets, configuredTargets and sdl3IncludeDir, and
    klyph.sdl3.download=false to stop the build instead of downloading SDL3.

Changed

  • isJustPressed and isJustReleased count fixed steps inside FIXED_UPDATE: each press is seen
    by exactly one step. A game that latched presses from INPUT for the next step can drop the latch.
  • Rooftop Roller runs on KinematicBody and Solid; its own physics code is gone.
  • Collisions.toString includes solids=N.