Pyxen Scripting Reference
Welcome to the Pyxen scripting API reference.
For concepts and tutorials, see the documentation.
Modules
| Module | Description |
|---|---|
world | Entity lifecycle and queries |
input | Keyboard, mouse, touch, gamepads |
screen | Screen dimensions |
time | Frame timing |
log | Debug logging |
Types
| Type | Description |
|---|---|
Entity | Lightweight handle for game objects |
Camera | View and projection control |
GridBody | Grid-based collision body |
GridMap | Tile grid container |
Sprite | Renderable image |
Sound | Short audio clip (WAV) |
Music | Streamed audio track (OGG) |
Quick Example
player = world.spawn(
name="player",
sprite=Sprite("hero"),
x=32, y=32
)
player.health = {'value': 100}
for e in world.all("health"):
e.health.value -= 1
world.destroy(player)