MCPcopy Index your code
hub / github.com/AlmasB/FXGLGames

github.com/AlmasB/FXGLGames @1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0 ↗ · + Follow
1,716 symbols 3,387 edges 292 files 379 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

This repo contains sample games built with FXGL Game Library. Each game focuses on one or two aspects of FXGL, e.g. Drop focuses on bare minimums, Pac-man focuses on AI, etc.

Checkout this commit for Java 8 code for all projects (FXGL 0.5.4). All projects will eventually be upgraded to Java 11 code (FXGL 11.0+).

Build

cd PROJECT_NAME
mvn package

This will produce a standalone executable with that project in target/. Most games are pre-built and can be downloaded from binaries.

Run

cd target/
java -jar PROJECT_NAME-VERSION.jar

OR simply double-click the jar file if the extensions are correctly set on your machine.

Build for Mobile

Follow latest instructions from client-samples. A relevant extract is copied below.

For example, to build Breakout for Android (can only build from Linux):

  1. Download GraalVM zip: graalvm-ce-java11-linux-amd64-20.2.0.tar.gz

  2. Set GRAALVM_HOME and JAVA_HOME environment variables to the GraalVM installation directory. For example:

export GRAALVM_HOME=/opt/graalvm-ce-java11-20.2.0
export JAVA_HOME=$GRAALVM_HOME

3.

cd Breakout
mvn clean client:build
mvn client:package

// connect your Android device and allow it installation over USB

mvn client:install

You can now run the game from Android, or you can run with logging from Linux: mvn client:run.

Contribute

These game demos are constantly upgraded, so feel free to fork and add something of your own.

Projects by difficulty

Beginner

Intermediate

Advanced

Community

You are very welcome to contribute to any of these games, or link to your own games. List of community developed games / demos: (Please add links below)

Extension points exported contracts — how you extend this code

NonBlockingSemaphore (Interface)
A counting semaphore that does not block the thread when the requested resource is not available. No actual resource obj [2 …
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/semaphore/NonBlockingSemaphore.java
SkillHandler (Interface)
@author Almas Baimagambetov (almaslvl@gmail.com)
NinjaCardCombat/src/main/java/com/almasb/fxglgames/ncc/SkillHandler.java
Factory (Interface)
Abstract factory for creating concrete instances of classes implementing NonBlockingSemaphore. @author davebaol [1 implementers]
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/semaphore/NonBlockingSemaphore.java
GoapListener (Interface)
* Any agent that wants to use GOAP must implement this interface. * It provides information to the GOAP * planner so i
BattleTanks/src/main/kotlin/com/almasb/fxgl/ai/goap/GoapListener.kt
Listener (Interface)
The listener interface for receiving task events. The class that is interested in processing a task event implements thi
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/BehaviorTree.java

Core symbols most depended-on inside this repo

get
called by 130
Pacman/src/main/java/com/almasb/fxglgames/pacman/PacmanFactory.java
add
called by 88
BattleTanks/src/main/kotlin/com/almasb/fxgl/ai/goap/WorldState.kt
getPosition
called by 84
GeometryWars/src/main/java/com/almasb/fxglgames/geowars/component/GridComponent.java
getEntity
called by 79
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/Task.java
distance
called by 37
BattleTanks/src/main/java/com/almasb/fxglgames/tanks/actions/GuardAction.java
getValue
called by 24
TicTacToe/src/main/java/com/almasb/fxglgames/tictactoe/TileViewComponent.java
spawnEnemy
called by 23
SpaceInvaders/src/main/java/com/almasb/fxglgames/spaceinvaders/level/SpaceLevel.java
addChild
called by 20
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/Task.java

Shape

Method 1,366
Class 305
Enum 36
Interface 5
Function 4

Languages

Java92%
Kotlin8%

Modules by API surface

BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/utils/BehaviorTreeParser.java55 symbols
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/BehaviorTree.java32 symbols
Breakout/src/main/java/com/almasb/fxglgames/breakout/components/BallComponent.java30 symbols
SpaceInvaders/src/main/java/com/almasb/fxglgames/spaceinvaders/SpaceInvadersApp.java29 symbols
BattleTanks/src/main/java/com/almasb/fxglgames/tanks/GoapSample.java29 symbols
NinjaCardCombat/src/main/java/com/almasb/fxglgames/ncc/CardComponent.java28 symbols
GeoJumper/src/main/kotlin/com/almasb/fxglgames/geojumper/GeoJumperApp.kt27 symbols
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/Task.java27 symbols
GeometryWars/src/main/java/com/almasb/fxglgames/geowars/component/GridComponent.java25 symbols
BattleTanks/src/main/java/com/almasb/fxgl/ai/btree/utils/BehaviorTreeReader.java22 symbols
Breakout/src/main/java/com/almasb/fxglgames/breakout/BreakoutApp.java20 symbols
SpaceInvaders/src/main/java/com/almasb/fxglgames/spaceinvaders/SpaceInvadersFactory.java18 symbols

For agents

$ claude mcp add FXGLGames \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact