How spartanlabsgaming/mygametools works
GameTools is a Kotlin engine library for reusable 2D game simulation and multiplayer networking. A game client sends input or typed commands to the UDP server; the server decodes them and invokes application callbacks. The application’s world models entities, movement and combat, advances them through ticks, and maintains spatial state; the server can broadcast drawable snapshots back to clients. Map definitions and loading, event publication, and optional simulation-loop driving are supporting capabilities. The map and several runtime integrations are represented from README/tree evidence where their source was not sampled.
Main entry points: GameServer.kt GameServer · World.kt World · TiledMap.kt Tiled map · SpatialIndex.kt Spatial index
Components 24
World and Maps
- World
gametools-core/src/main/kotlin/com/spartanlabs/gaming/gameobjects/World.kt - Map loader
gametools-world/src/main/kotlin/com/spartanlabs/gaming/world/map/MapLoader.kt - Tiled map
gametools-world/src/main/kotlin/com/spartanlabs/gaming/world/map/TiledMap.kt - Terrain and obstacles
gametools-world/src/main/kotlin/com/spartanlabs/gaming/world/map/TerrainLayer.kt - Spawn points
gametools-world/src/main/kotlin/com/spartanlabs/gaming/world/map/SpawnPoint.kt
Game Objects
- Game objects
gametools-core/src/main/kotlin/com/spartanlabs/gaming/gameobjects/GameObject.kt - Actors and movement
gametools-core/src/main/kotlin/com/spartanlabs/gaming/gameobjects/Actor.kt - Combat and projectiles
gametools-core/src/main/kotlin/com/spartanlabs/gaming/gameobjects/Alive.kt - Stats and buffs
gametools-core/src/main/kotlin/com/spartanlabs/gaming/gameobjects/ModularStat.kt - Drawable snapshots
gametools-core/src/main/kotlin/com/spartanlabs/gaming/gameobjects/VisibleObject.kt
Simulation Services
- Spatial index
gametools-core/src/main/kotlin/com/spartanlabs/gaming/spatial/SpatialIndex.kt - Quadtree index
gametools-core/src/main/kotlin/com/spartanlabs/gaming/spatial/QuadtreeSpatialIndex.kt - Uniform grid
gametools-core/src/main/kotlin/com/spartanlabs/gaming/spatial/UniformGrid.kt - Simulation loop
gametools-core/src/main/kotlin/com/spartanlabs/gaming/simulation/SimulationLoop.kt - World events
gametools-core/src/main/kotlin/com/spartanlabs/gaming/event/EventBus.kt - Game events
gametools-core/src/main/kotlin/com/spartanlabs/gaming/event/GameEvent.kt
Networking
- GameServer
gametools-net/src/main/kotlin/com/spartanlabs/gaming/networking/GameServer.kt - Mouse input
gametools-net/src/main/kotlin/com/spartanlabs/gaming/networking/MouseAction.kt - Command codec
gametools-net/src/main/kotlin/com/spartanlabs/gaming/networking/command/ClientCommandCodec.kt - Client commands
gametools-net/src/main/kotlin/com/spartanlabs/gaming/networking/command/ClientCommand.kt - Command applier
gametools-net/src/main/kotlin/com/spartanlabs/gaming/networking/command/StandardCommandApplier.kt
Other components
- Game client
- UDP transport
- Game application
Connections 24
- Game client → UDP transport: sends datagrams
- UDP transport → GameServer: delivers datagrams
- GameServer → Mouse input: decodes input
- GameServer → Command codec: decodes commands
- Command codec → Client commands: produces commands
- GameServer → Game application: invokes callbacks
- Game application → Command applier: applies commands
- Command applier → World: mutates world
- Game application → World: drives gameplay
- Map loader → Tiled map: loads map
- Tiled map → Terrain and obstacles: uses terrain
- Tiled map → Spawn points: tracks spawns
- World → Game objects: owns objects
- Game objects → Actors and movement: extends objects
- Actors and movement → Combat and projectiles: extends actors
- Combat and projectiles → Stats and buffs: uses stats
- World → Spatial index: maintains positions
- Quadtree index → Spatial index: implements index
- Uniform grid → Spatial index: implements index
- Simulation loop → World: ticks world
- World → World events: publishes events
- World events → Game events: delivers events
- GameServer → Drawable snapshots: broadcasts snapshots
- GameServer → Game client: broadcasts state