Built-in gameplay components¶
arepy.bundle contains common components and two starter systems. They are
convenient defaults, not a required game framework; custom components work
alongside them.
2D components¶
Transform¶
Transform answers where and how a 2D object is placed:
position: Vec2scale: Vec2origin: Vec2rotation: float
Each instance owns its vectors. Prefer changing their coordinates in place:
RigidBody2D¶
RigidBody2D stores movement data such as velocity, acceleration,
deceleration, and maximum velocity. It is data, not a full collision or rigid
body physics simulation.
Sprite¶
Sprite identifies a loaded texture and its source region:
The texture itself belongs in AssetStore; many entities can reference the
same handle by name.
3D components¶
The bundle also exports:
Transform3DCamera3DModel3DandMesh3DMaterial3DLight3D
RigidBody3D exists in its component module but is not currently re-exported
from arepy.bundle.components; advanced examples import it from
arepy.bundle.components.rigidbody.
Camera2D is available for 2D world-to-screen transforms.
Bundled systems¶
movement_system moves Transform values from RigidBody2D.velocity and
bounces them inside its demonstration bounds. render_system draws
Transform + Sprite entities, using the texture atlas and batch path when one
has been built.
They are useful for examples. A real game will often replace them with systems that know its own level bounds, collisions, animation, and draw order.
from arepy.bundle.systems import movement_system, render_system
world.add_system(SystemPipeline.UPDATE, movement_system)
world.add_system(SystemPipeline.RENDER, render_system)
Examples¶
getting_started.pycombines the 2D components with keyboard and mouse input.bunnymark.pyuses the same data in a large vectorized sprite batch.cubemark_3d.pydemonstrates the 3D renderer and transforms.
Continue with Graphics and textures for asset loading and drawing, or ECS basics to create your own components.