A simple demonstration of SolarSail's entity-component system showing a ball bouncing around the screen edges.
- SolarSail's coordinate system (origin at center)
- Entity creation with components
- Script components with
on_init()andon_update() - Transform manipulation
- Sprite rendering with atlas
- Basic physics and collision detection
The demo includes a custom 3D-looking red ball created with SVG:
-
Created SVG (
ball_transparent.svg):- Radial gradient from white highlight to bright red (#ff6b6b) to dark red (#c92a2a)
- White highlight ellipse for shine effect
- Subtle shadow underneath
- 64x64 pixel dimensions
-
PNG Conversion with Transparency:
- ImageMagick's
convertcommand failed to preserve transparency properly - Solution: Use Inkscape for SVG to PNG conversion
inkscape ball_transparent.svg --export-type=png --export-filename=ball.png --export-width=64 --export-height=64
- ImageMagick's
-
Atlas Creation:
- Copy
ball.pngasatlas.png(single sprite atlas) - Update
atlas.luato define one sprite named "ball"
- Copy
cd /home/dagostinelli/projects/solarsail/bouncingball
make runPress 'q' to quit.
program.lua- Engine callbacks and window creationgame.json- Scene definition with ball entityball.lua- Ball physics and movement logicconfig.lua- Screen bounds and ball parameters
- Coordinate System: Origin (0,0) is at screen center
- World Coordinates: X: -1.78 to +1.78, Y: -1.0 to +1.0
- No dt parameter:
on_update()doesn't receive delta time - Transform property: Use
transform.translation, nottransform.position
See GETTING_STARTED.md for a detailed tutorial.
