Basics
Guides
API Reference
Basics
Guides
API Reference
[20:7] extends: FxObj
Wraps FXGL's GameWorld, the container for every entity in a scene. Aussom users add entities directly (for ad-hoc spawning) or register an EntityFactory and call spawn(name, data) to produce entities from a factory method. addWorldListener observes entity-level add and remove events. GameWorld is usually obtained via fxgl.getGameWorld in chunk 6; direct construction is supported for tests and standalone use.
GameWorld (Ajo = null)
Creates a GameWorld wrapper. With no argument constructs a new empty FXGL GameWorld; with an AussomJavaObject wraps the supplied existing GameWorld (used by fxgl.getGameWorld to hand back a ready-to-use wrapper).
Ajo is an optional AussomJavaObject around an FXGL GameWorld.adopt (object Ajo)
Wraps an existing GameWorld AussomJavaObject.
Ajo is an AussomJavaObject around a GameWorld.A new wrapper.addEntity (object EntityObj)
Adds an entity to the world.
EntityObj is an Entity wrapper.this objectremoveEntity (object EntityObj)
Removes the entity from the world.
EntityObj is an Entity wrapper.this objectonUpdate (double Tpf)
Drives the world one update tick. Calls onUpdate on every component of every active entity. Normally driven by the scene automatically.
Tpf is the elapsed time in seconds.this objectaddWorldListener (callback OnAdded = null, callback OnRemoved = null)
Registers a listener that fires when an entity is added or removed from the world.
OnAdded is a callback receiving the added entity, or null.OnRemoved is a callback receiving the removed entity, or null.An AussomJavaObject wrapping the registered listener.removeWorldListener (object Listener)
Removes a previously registered world listener.
Listener is the AussomJavaObject returned by addWorldListener.this objectaddEntityFactory (object FactoryObj)
Adds an EntityFactory whose @Spawns methods become available to spawn(name, data).
FactoryObj is an AussomJavaObject around an EntityFactory.this objectspawn (string EntityName, double X = 0.0, double Y = 0.0)
Spawns an entity through a previously registered EntityFactory.
EntityName is the spawn method name (matching @Spawns).X is the X position (defaults to 0.0).Y is the Y position (defaults to 0.0).An Entity wrapper around the spawned entity.spawnWithData (string EntityName, object Data)
Spawns an entity using a SpawnData bundle for custom factory arguments.
EntityName is the spawn method name.Data is a SpawnData wrapper.An Entity wrapper.getEntityCount ()
Returns the count of currently active entities.
An int.getProperties ()
Returns the GameWorld's shared PropertyMap of world-level variables.
A PropertyMap wrapper.reset ()
Clears the world of all entities and listeners.
this object_entityList (javaList)
_optEntity (rawAjo)
getEntitiesByType (list Types)
Returns every entity whose type matches one of the supplied values. Filters in-Aussom against
Entity.isType(value), which is lenient — any Serializable the entity's factory used as its type tag matches, so strings, enum AJOs, or raw values all work. (FXGL'sgetEntitiesByType(vararg Enum<*>)requires compile-time Enum<*> at the JVM call signature, which rules out String type tags even thoughEntity.isTypeitself accepts them.)
Types is a list of type values.A list of Entity wrappers.getEntitiesByComponent (string ClassName)
Returns every entity carrying a component of the named Java class.
ClassName is the fully qualified component class name.A list of Entity wrappers.getEntitiesAt (double X, double Y)
Returns every entity whose bounding box contains the given point in world coordinates.
X is the world X.Y is the world Y.A list of Entity wrappers.getEntitiesInRange (double X, double Y, double W, double H)
Returns every entity whose bounding box overlaps the given rectangle in world coordinates.
X is the rect X.Y is the rect Y.W is the rect width.H is the rect height.A list of Entity wrappers.getEntitiesFiltered (callback Predicate)
Returns every entity matching the supplied predicate callback.
Predicate is a callback (entity) -> bool.A list of Entity wrappers.getSingletonOptional (callback Predicate)
Returns the unique entity matching the supplied predicate, or null when none exists.
Predicate is a callback (entity) -> bool.An Entity wrapper or null.getRandom (callback Predicate)
Returns a random entity matching the supplied predicate, or null when none exists.
Predicate is a callback (entity) -> bool.An Entity wrapper or null.getClosestEntity (object Source, callback Filter)
Returns the entity closest to the given source entity matching the supplied filter, or null when none exists.
Source is an Entity wrapper used as the anchor.Filter is a callback (entity) -> bool.An Entity wrapper or null.getEntityByID (string Name, int Id)
Returns the entity with the given Name + ID, or null if not found. The Name corresponds to the entity factory's @Spawns name and ID is the auto-assigned index.
Name is the entity name.Id is the entity ID.An Entity wrapper or null.setLevel (object LevelObj)
Replaces the world's content with the entities and properties of the given Level.
LevelObj is an AussomJavaObject around an FXGL Level.this objectgetEntities ()
Returns the full live ArrayList
of active entities as an AJO. Iterate via .invoke("size") + .invokeRaw("get", i).
getEntitiesCopy ()
Returns a defensive copy of the entity list as an AJO. Safe to hand to long-running operations that might mutate the world during iteration.
addEntities (list Entities)
Adds multiple entities in one call. Accepts an Aussom list of Entity wrappers.
removeEntities (list Entities)
Removes multiple entities in one call.
create (string EntityName, object SpawnDataObj)
Creates an entity by factory name + SpawnData without adding it to the world. Use when you need to configure further before insertion.
getCollidingEntities (object EntityObj)
Returns every entity colliding with the supplied entity.
getEntitiesByComponentMapped (string ClassName)
Returns a Map<Entity, Component> AJO of every entity carrying the named component class, keyed by entity, valued by the component instance.
getSingleton (callback Predicate)
Returns the unique entity tagged with the supplied type, or throws when none / more than one exists. Use the predicate overload (getSingletonOptional) for safer access.
getGroup (list TypeEnums)
Returns an EntityGroup AJO that auto-tracks every entity matching one of the supplied type tags. Accepts a list of enum AJOs.
removeEntityFactory (object FactoryObj)
Removes a previously-added EntityFactory.

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.