Frice-DSL: A DSL engine for simple games


#1

Hi there, I’ve just release a DSL lib for game creating at https://github.com/icela/FriceEngine-DSL. The core is a thin wrapper of Frice Engine, which is another simple lib, also written in Kotlin.

Here I’d like to give some examples, like:

Creating objects:

import org.frice.dsl.game

fun main(args: Array<String>) {
	game {
		size(300, 300)
		showFPS = false
		oval { // create an oval, located at (233, 233), you can also set the width and height.
			x = 100.0
			y = 100.0
		}
		button { // create an button
			text = "deep dark fantasy"
			x = 10.0
			y = 10.0
			width = 200.0
		}
	}
}

Adding animations:

import org.frice.dsl.game

fun main(args: Array<String>) {
	game {
		oval {
			x = 10.0
			y = 10.0
			velocity {
				x = 100.0
			}
			accelerate {
				y = 2.0
			} // so that you can see a red ball falling from the left-top of the window.
		}
	}
}

for more info please view this project on GitHub. There is a demo showing more features there.

It’s an easy way to create simple games with GUI.
The DSL is also friendly to people who know nothing about Kotlin, even programming.

Cheers,
ice1000


#2

ignore this comment, it is for testing

https://github.com/icela/FriceEngine-DSL