GameLib

A small library written in Kotlin and Java for creating games during introductory OOP course.

How GameLib works

There are several base entities that constitute a game created with GameLib. They can be found as interfaces in the core GameLib module.

  • Game represents a game application. It consists of one or more scenes, one of which is always active - it is shown in the game window.
  • Scene can be described as a 2D game environment, consisting of a map (graphical representation of the environment), a collection of actors (entities within the environment), and a collection of actions (behaviour of either actors or environment).
  • Map is a graphical representation of scene environment that consist of tiles (usually with dimensions of 16x16 pixels). May contain additional information, e.g., presence of walls or markers positioned on predefined areas.
  • Actor represents a game entity like a player, an enemy or an object. It has its position in the scene and is represented by a sprite created from the Animation class.
  • Action represents an encapsulated piece of actor's behaviour. All actions are executed by scene, one by one, each time the scene is going to be rendered on screen (usually, 60 times per second). After an action is executed, it may change its status to done, in which case it won't be executed again.
Base interfaces and classes of _GameLib_.
Obr. 1: Base interfaces and classes of GameLib.

GameLib changelog

v2.4.2 (25.11.2018)

Enhancements:

  • [core] Provide cancelActions() method on Scene

Fixes:

  • [core] Fix for tiles outside map
  • [framework] Fix Rotate action

v2.4.1 (18.11.2018)

Fixes:

  • Fixed an issue with detecting intersects with walls.

v2.4.0 (11.11.2018)

New features:

  • [core] Highlight actor at the top of container in ActorContainerPanel.

Changes:

  • [core] Add type parameters for actors to Invoke and Wait actions.
  • [core] Schedule new actions to be executed before older ones in World.
  • [framework] Rename Move action to Translate.
  • [framework] Add type parameters to Rotate and Translate actions.

Fixes:

  • [core] Fix processing of BACKSPACE and DELETE keys in Input.

v2.3.1 (4.11.2018)

Fixes:

  • Expose overloaded constructor for InspectableScene to Java.

v2.3.0 (1.11.2018)

Changes:

  • Varargs method setActorRenderOrder() changed to one accepting list of classes.
  • Extracted interfaces for Overlay and Game.
  • Changes in application construction.

Fixes:

  • Fixed TemporalAction duration check.
  • Better toString() methods for Animation and AbstractActor.

Deprecations:

  • Varargs version of setActorRenderOrder() is now deprecated as it causes unchecked operation warning. It is superseeded by method accepting list of classes.

v2.2.0 (21.10.2018)

New features:

  • Methods Scene.scheduleAction() and Action.scheduleOn() now return Disposable object that unschedules the action when its dispose() method is called.
  • Actor rendering order can be configured with method setActorRenderOrder() on scene.
  • Animations expose index of currently shown frame and total number of frames.

Changes:

  • Updated documentation.
  • Updated training map in Framework module.

v2.1.0 (14.10.2018)

New features:

  • [core] Map tile objects.
  • [core] Overlay drawings with configurable display time.
  • [framework] Loop action that repeats wrapped action endlessly.

Changes:

  • [core] Actor's scene is now nullable.
  • [core] Scene setter on Actor replaced with addedToScene() and removedFromScene() methods.
  • [framework] Player has energy.

Fixes:

  • [framework] AbstractAction moved to correct package.
  • [inspector] Inspector updated to 1.0.2 (fixes parameter order in operation invocation).

v2.0.2 (07.10.2018)

Fixes:

  • Game now closes correctly and does not force call to System.exit(-1) (from LibGDX).

v2.0.1 (04.10.2018)

Fixes:

  • Backend changed to LWJGL2 to prevent issues on Mac OS.

v2.0.0 (30.09.2018)

  • Initial version of GameLib built on top of LibGDX.

How to update GameLib in your project-ellen project

project-ellen uses Gradle to manage its dependencies. The process of updating the GameLib library to a version x.x.x is as follows:

  1. Open file build.gradle.kts from the root directory of your project.
  2. Change value of the gamelibVersion variable to the required version:
val gamelibVersion = "x.x.x"
  1. After the change the IDE will show a notification about required import of Gradle project changes. Click on Import Changes.