Skip to content

hbmartin/openrndr-game-of-life

Repository files navigation

Conway's Game of Life in Kotlin / OPENRNDR

Build on commit CodeFactor Maintainability Rating

icon

An implementation of Conway's Game of Life using OPENRNDR in Kotlin.

Inspired by Golly and the Edwin Jakobs KotlinConf talk.

Get Started

Download the latest release for your platform and use the controls to interact.

screenshot

Controls

  • Click and drag on the canvas to create new life
  • Scroll up and down to control generation time
  • space to pause / resume the simulation
  • esc to reset current pattern to the initial state
  • r to reset to a randomly chosen pattern
  • c to reset to a randomized canvas
  • s to save the current state to an RLE / Golly file
  • l to load a state from an RLE / Golly file
  • i to toggle info text (generation # and FPS)
  • (TODO) Press 'g' to toggle grid visibility
  • (TODO) Press 'f' to toggle fullscreen mode
  • q to quit the program

Settings

  • Press period . or comma , to open the settings panel
  • Select a new background color
  • Choose a new pattern

Gradle tasks

  • ./gradlew run runs the TemplateProgram (Use gradlew.bat run under Windows)
  • ./gradlew shadowJar creates an executable platform specific jar file with all dependencies. Run the resulting program by typing java -jar build/libs/<name-version>.jar in a terminal from the project root.
  • ./gradlew jpackageZip creates a zip with a stand-alone executable for the current platform (works with Java 14 only)

Cross builds

To create a runnable jar for a platform different from your current platform, use ./gradlew jar -PtargetPlatform=<platform>, where <platform> is either windows, macos, linux-x64, or linux-arm64.

See also