https://github.com/quillraven/ggdxai-example
A small example project to demonstrate how to use GdxAI's statemachine and message handling for simple state and AI handling
https://github.com/quillraven/ggdxai-example
gdxai kotlin libgdx libktx
Last synced: 10 months ago
JSON representation
A small example project to demonstrate how to use GdxAI's statemachine and message handling for simple state and AI handling
- Host: GitHub
- URL: https://github.com/quillraven/ggdxai-example
- Owner: Quillraven
- License: mit
- Created: 2020-12-18T15:18:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-17T14:18:21.000Z (about 1 year ago)
- Last Synced: 2025-08-30T23:43:45.243Z (10 months ago)
- Topics: gdxai, kotlin, libgdx, libktx
- Language: Kotlin
- Homepage:
- Size: 299 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://kotlinlang.org/)
[](https://libgdx.badlogicgames.com/)
[](https://libktx.github.io/)

# GdxAI Example
This is an example project on how to use GdxAI's state machine and message dispatching functionality
to create a player character that can have following states:
* Idle
* Run
* Jump
* Fall
* Attack (three different attack states)
In addition, there is a priest character who will heal the player if injured. The priest has these states:
* Idle
* Run
* Cast
The project uses LibGDX, LibKTX, Box2D and Ashley. The components and systems are just a quick&dirt
implementation, but you can of course use them as a reference.
The main focus however sits in `com.github.quillraven.gdxaiexample.ai` package and `com.github.quillraven.gdxaiexample.ecs.system/ai.kt`
which are showing how you can use GdxAI for simple AI.
Player controls:
* A -> Attack
* J -> Jump
* LEFT/RIGHT -> Move
`I` will trigger a delayed injured event to let the priest know that the player needs healing.
The code is explained in more detail in following video: [Link to YouTube](https://www.youtube.com/watch?v=LqAmBdKfPXU&ab_channel=Quillraven)