Kanama¶
Kanama lets you write Godot 4 scripts in Kotlin. A .kt file attaches to a
node like a .gd file does, and every Godot class, method, property and signal
has a Kotlin twin with Godot's own documentation, so IntelliJ IDEA completes
the whole engine API. You keep the Godot editor and your scenes; you gain
Kotlin, Gradle, coroutines and the Java libraries. Your game runs on desktop,
Android and iOS, and experimentally in the browser.
@ScriptClass(attachTo = "CharacterBody2D")
class Player(godotObject: GodotHandle) :
KanamaScript<CharacterBody2D>(godotObject, ::CharacterBody2D) {
@Export
var speed: Double = 300.0
@OnPhysicsProcess
fun physicsProcess(delta: Double) {
val input = Input.getVector("ui_left", "ui_right", "ui_up", "ui_down")
self.velocity = input * speed
self.moveAndSlide()
}
}
Where to Start¶
- New to Kanama? Get Started takes you from nothing installed to a Kotlin script running in a scene.
- Ready to write game code? Writing Scripts and
Calling Godot APIs cover what differs from
GDScript:
self, immutable vectors, rebuilding after an edit, and releasing resources. Porting an existing game? Read Porting from GDScript. - Changing Kanama itself? Develop Kanama has the architecture, the generator, the backends and the checks.
Platform Status¶
The badges above are the current status of each platform. Release 0.4.0 runs
on Godot 4.7.2. The main branch builds on Godot 4.8 beta 2, and 0.5.0 ships on
4.8 stable; see Godot Version.
Requirements and Platform Status lists what
each workflow needs and what each platform has been tested on.
Kanama is a preview, and not the only way to use Kotlin with Godot. Godot Kotlin/JVM is a separate, more established project with a different runtime and export model. If you need a proven integration today, evaluate it too.
Kanama is distributed under the MIT license.