Skip to content

KirCute/FriceEngine

 
 

Repository files navigation

FriceEngine

image

CI status
Travis CI Build Status
AppVeyor Build status
CircleCI CircleCI
CodeShip CodeShip

Awesome Kotlin Badge

An easy, light, native game engine running on JVM.
View APIs or wiki to learn more about Frice Engine.

The doc is poorly maintained and deprecated. I'm deciding to make some tutorials soon.

Why easy?

A flappy bird game uses just 65 lines of code only.
Written in Kotlin, also work on Java, JRuby, Groovy and Scala.

Why light?

The release build jar is about 300kb (with a 800kb Kotlin runtime) only.

Why native?

This engine is completely platform-independent: no JNI linkage, no native methods, everything is written in pure Kotlin.

Build

Add code below to your gradle scrip:

allprojects {
  repositories {
    /// ...
    maven { url 'https://jitpack.io' }
  }
}

dependencies {
  compile 'com.github.icela:FriceEngine:v1.4.0'
}

Usage

Supported

Languages

  • Kotlin
  • Java
  • Groovy
  • Scala

Progress

  • Game Objects (from image or shape, image from file or web)
  • Life cycle
  • Collision detecting
  • Audio playing (*.wav, *.mp3 only)
  • Dialogs
  • Cursor overriding
  • Clock system
  • Animations (frames, moving, scaling, accelerations, etc.)
  • A simple key-value database
  • Screen cut
  • Buttons
  • Particle effects
  • Easy time controlling
  • Language extensions (for Kotlin only)
  • Smart auto garbage collection (you can close it (objects far from the screen will be removed))
  • Resource manager(when you read files/urls, the result will be cached)
  • File/URL utils
  • A BoolArray implemented in bitwise operation, each boolean value will only take 1 bit space (instead of 1 byte which is default on JVM).

DSL

see DSL for FriceEngine

Basics

FriceEngine is based on the life cycle mode.
To build games based on frice engine, follow these steps:

  1. Import the jar in the latest release to your project, or add dependency in your build.gradle file.
  2. Create a class extends Game in org.frice.game package.
  3. Override the life cycle methods(onInit, onExit, onLastInit, onRefresh, onFocus, onLoseFocus), just understand them by name.
  4. If you want to draw something additionally, override customDraw. This method will be invoked every time after all game objects drawn.
  5. Write launch(YourGameClass.class) in the main function.
  6. Feel free to open issue for feature request, bugs, etc.

Demos

see FriceDemo

Packages

 
 
 

Languages

  • Kotlin 100.0%