spore-engine 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spore_engine-0.1.0/LICENSE +121 -0
- spore_engine-0.1.0/PKG-INFO +342 -0
- spore_engine-0.1.0/README.md +299 -0
- spore_engine-0.1.0/demo.py +500 -0
- spore_engine-0.1.0/demos/__init__.py +272 -0
- spore_engine-0.1.0/demos/scene_3d.py +223 -0
- spore_engine-0.1.0/demos/scene_abyssal_bloom.py +515 -0
- spore_engine-0.1.0/demos/scene_anim.py +90 -0
- spore_engine-0.1.0/demos/scene_anim_path.py +94 -0
- spore_engine-0.1.0/demos/scene_astral_cathedral.py +103 -0
- spore_engine-0.1.0/demos/scene_aurora.py +57 -0
- spore_engine-0.1.0/demos/scene_aurora_lagoon.py +444 -0
- spore_engine-0.1.0/demos/scene_aurora_palace.py +106 -0
- spore_engine-0.1.0/demos/scene_aurora_storm.py +115 -0
- spore_engine-0.1.0/demos/scene_autumn_forest.py +730 -0
- spore_engine-0.1.0/demos/scene_bioluminescence.py +78 -0
- spore_engine-0.1.0/demos/scene_biome_demo.py +25 -0
- spore_engine-0.1.0/demos/scene_black_hole.py +134 -0
- spore_engine-0.1.0/demos/scene_braille_current.py +149 -0
- spore_engine-0.1.0/demos/scene_celestial_temple.py +123 -0
- spore_engine-0.1.0/demos/scene_cellular.py +66 -0
- spore_engine-0.1.0/demos/scene_code_shader.py +121 -0
- spore_engine-0.1.0/demos/scene_constellation.py +131 -0
- spore_engine-0.1.0/demos/scene_cosmic_tunnel.py +126 -0
- spore_engine-0.1.0/demos/scene_crystal_cluster.py +133 -0
- spore_engine-0.1.0/demos/scene_crystal_nebula.py +133 -0
- spore_engine-0.1.0/demos/scene_dna.py +56 -0
- spore_engine-0.1.0/demos/scene_double_pendulum.py +115 -0
- spore_engine-0.1.0/demos/scene_dungeon.py +44 -0
- spore_engine-0.1.0/demos/scene_eclipse.py +97 -0
- spore_engine-0.1.0/demos/scene_ecs_lifecycle.py +281 -0
- spore_engine-0.1.0/demos/scene_ecs_swarm.py +286 -0
- spore_engine-0.1.0/demos/scene_erosion.py +51 -0
- spore_engine-0.1.0/demos/scene_ethereal_ruins.py +225 -0
- spore_engine-0.1.0/demos/scene_field_demo.py +59 -0
- spore_engine-0.1.0/demos/scene_fireflies.py +118 -0
- spore_engine-0.1.0/demos/scene_flocking.py +135 -0
- spore_engine-0.1.0/demos/scene_flowfield.py +97 -0
- spore_engine-0.1.0/demos/scene_forest_fire.py +89 -0
- spore_engine-0.1.0/demos/scene_fractals.py +74 -0
- spore_engine-0.1.0/demos/scene_fx.py +126 -0
- spore_engine-0.1.0/demos/scene_galaxy.py +84 -0
- spore_engine-0.1.0/demos/scene_geometric_flower.py +97 -0
- spore_engine-0.1.0/demos/scene_glyph_art.py +157 -0
- spore_engine-0.1.0/demos/scene_god_rays.py +269 -0
- spore_engine-0.1.0/demos/scene_golden_city.py +108 -0
- spore_engine-0.1.0/demos/scene_gravity.py +128 -0
- spore_engine-0.1.0/demos/scene_horizon.py +395 -0
- spore_engine-0.1.0/demos/scene_hypercube.py +119 -0
- spore_engine-0.1.0/demos/scene_infinite_temple.py +152 -0
- spore_engine-0.1.0/demos/scene_isometric.py +46 -0
- spore_engine-0.1.0/demos/scene_kaleidoscope.py +41 -0
- spore_engine-0.1.0/demos/scene_landscape.py +102 -0
- spore_engine-0.1.0/demos/scene_lava.py +80 -0
- spore_engine-0.1.0/demos/scene_lightning.py +77 -0
- spore_engine-0.1.0/demos/scene_lorenz.py +89 -0
- spore_engine-0.1.0/demos/scene_media_player.py +119 -0
- spore_engine-0.1.0/demos/scene_meteor.py +80 -0
- spore_engine-0.1.0/demos/scene_misc.py +106 -0
- spore_engine-0.1.0/demos/scene_neon_cathedral.py +122 -0
- spore_engine-0.1.0/demos/scene_neon_city.py +150 -0
- spore_engine-0.1.0/demos/scene_neon_grid.py +54 -0
- spore_engine-0.1.0/demos/scene_new_features.py +97 -0
- spore_engine-0.1.0/demos/scene_new_features2.py +377 -0
- spore_engine-0.1.0/demos/scene_particles.py +84 -0
- spore_engine-0.1.0/demos/scene_phantom_galaxy.py +78 -0
- spore_engine-0.1.0/demos/scene_phoenix.py +148 -0
- spore_engine-0.1.0/demos/scene_phosphor.py +171 -0
- spore_engine-0.1.0/demos/scene_photo_ascii.py +46 -0
- spore_engine-0.1.0/demos/scene_physics_enhanced.py +131 -0
- spore_engine-0.1.0/demos/scene_physics_rigid.py +103 -0
- spore_engine-0.1.0/demos/scene_platformer.py +174 -0
- spore_engine-0.1.0/demos/scene_powder.py +74 -0
- spore_engine-0.1.0/demos/scene_prism_raytracer.py +72 -0
- spore_engine-0.1.0/demos/scene_ragdoll.py +300 -0
- spore_engine-0.1.0/demos/scene_raytracer_alien.py +37 -0
- spore_engine-0.1.0/demos/scene_raytracer_crystal.py +40 -0
- spore_engine-0.1.0/demos/scene_raytracer_infinity.py +37 -0
- spore_engine-0.1.0/demos/scene_raytracer_jewel.py +46 -0
- spore_engine-0.1.0/demos/scene_raytracer_moonlit.py +43 -0
- spore_engine-0.1.0/demos/scene_raytracer_nebula.py +42 -0
- spore_engine-0.1.0/demos/scene_raytracer_photo.py +36 -0
- spore_engine-0.1.0/demos/scene_raytracer_reflections.py +48 -0
- spore_engine-0.1.0/demos/scene_raytracer_system.py +36 -0
- spore_engine-0.1.0/demos/scene_raytracer_toybox.py +36 -0
- spore_engine-0.1.0/demos/scene_ripples.py +39 -0
- spore_engine-0.1.0/demos/scene_scenery.py +84 -0
- spore_engine-0.1.0/demos/scene_screenfx.py +84 -0
- spore_engine-0.1.0/demos/scene_sdf_csg.py +41 -0
- spore_engine-0.1.0/demos/scene_sdf_dreamscape.py +75 -0
- spore_engine-0.1.0/demos/scene_sdf_glow.py +45 -0
- spore_engine-0.1.0/demos/scene_shader_symphony.py +126 -0
- spore_engine-0.1.0/demos/scene_shaders.py +96 -0
- spore_engine-0.1.0/demos/scene_shadows.py +81 -0
- spore_engine-0.1.0/demos/scene_sierpinski.py +122 -0
- spore_engine-0.1.0/demos/scene_sim.py +65 -0
- spore_engine-0.1.0/demos/scene_solar_flare.py +57 -0
- spore_engine-0.1.0/demos/scene_spline_demo.py +55 -0
- spore_engine-0.1.0/demos/scene_stained_glass.py +68 -0
- spore_engine-0.1.0/demos/scene_starry_night.py +57 -0
- spore_engine-0.1.0/demos/scene_synthwave.py +126 -0
- spore_engine-0.1.0/demos/scene_terminal_app.py +284 -0
- spore_engine-0.1.0/demos/scene_terrain_flyover.py +71 -0
- spore_engine-0.1.0/demos/scene_tilemap.py +108 -0
- spore_engine-0.1.0/demos/scene_timeline.py +86 -0
- spore_engine-0.1.0/demos/scene_tui.py +199 -0
- spore_engine-0.1.0/demos/scene_tunnel.py +35 -0
- spore_engine-0.1.0/demos/scene_ui.py +82 -0
- spore_engine-0.1.0/demos/scene_underwater.py +105 -0
- spore_engine-0.1.0/demos/scene_video_player.py +76 -0
- spore_engine-0.1.0/demos/scene_voxel_world.py +59 -0
- spore_engine-0.1.0/demos/scene_walkers.py +317 -0
- spore_engine-0.1.0/demos/scene_worley.py +34 -0
- spore_engine-0.1.0/easy_demo.py +81 -0
- spore_engine-0.1.0/pyproject.toml +217 -0
- spore_engine-0.1.0/setup.cfg +4 -0
- spore_engine-0.1.0/shader_sandbox.py +26 -0
- spore_engine-0.1.0/spore_engine/__init__.py +170 -0
- spore_engine-0.1.0/spore_engine/__version__.py +4 -0
- spore_engine-0.1.0/spore_engine/anim/__init__.py +3 -0
- spore_engine-0.1.0/spore_engine/anim/anim.py +401 -0
- spore_engine-0.1.0/spore_engine/anim/ik.py +198 -0
- spore_engine-0.1.0/spore_engine/anim/timeline.py +191 -0
- spore_engine-0.1.0/spore_engine/cli.py +267 -0
- spore_engine-0.1.0/spore_engine/core/__init__.py +150 -0
- spore_engine-0.1.0/spore_engine/core/_accel.py +49 -0
- spore_engine-0.1.0/spore_engine/core/_optional.py +40 -0
- spore_engine-0.1.0/spore_engine/core/assets.py +324 -0
- spore_engine-0.1.0/spore_engine/core/camera.py +94 -0
- spore_engine-0.1.0/spore_engine/core/canvas.py +692 -0
- spore_engine-0.1.0/spore_engine/core/color.py +282 -0
- spore_engine-0.1.0/spore_engine/core/draw.py +542 -0
- spore_engine-0.1.0/spore_engine/core/ecs.py +197 -0
- spore_engine-0.1.0/spore_engine/core/geom.py +247 -0
- spore_engine-0.1.0/spore_engine/core/glyphs.py +62 -0
- spore_engine-0.1.0/spore_engine/core/input.py +702 -0
- spore_engine-0.1.0/spore_engine/core/reload.py +282 -0
- spore_engine-0.1.0/spore_engine/core/scene.py +145 -0
- spore_engine-0.1.0/spore_engine/core/scene_file.py +375 -0
- spore_engine-0.1.0/spore_engine/core/sprite.py +55 -0
- spore_engine-0.1.0/spore_engine/core/state.py +184 -0
- spore_engine-0.1.0/spore_engine/core/term.py +541 -0
- spore_engine-0.1.0/spore_engine/core/util.py +170 -0
- spore_engine-0.1.0/spore_engine/easy/__init__.py +17 -0
- spore_engine-0.1.0/spore_engine/easy/anim.py +164 -0
- spore_engine-0.1.0/spore_engine/easy/app.py +747 -0
- spore_engine-0.1.0/spore_engine/easy/sprite.py +297 -0
- spore_engine-0.1.0/spore_engine/easy/systems.py +908 -0
- spore_engine-0.1.0/spore_engine/easy/util.py +15 -0
- spore_engine-0.1.0/spore_engine/easy/widgets.py +101 -0
- spore_engine-0.1.0/spore_engine/fx/__init__.py +15 -0
- spore_engine-0.1.0/spore_engine/fx/effects.py +376 -0
- spore_engine-0.1.0/spore_engine/fx/field.py +117 -0
- spore_engine-0.1.0/spore_engine/fx/lightfield.py +621 -0
- spore_engine-0.1.0/spore_engine/fx/lighting.py +163 -0
- spore_engine-0.1.0/spore_engine/fx/postfx.py +268 -0
- spore_engine-0.1.0/spore_engine/fx/screenfx.py +157 -0
- spore_engine-0.1.0/spore_engine/fx/shader_lab.py +430 -0
- spore_engine-0.1.0/spore_engine/fx/shaderlab.py +345 -0
- spore_engine-0.1.0/spore_engine/fx/shaders.py +528 -0
- spore_engine-0.1.0/spore_engine/fx/textfx.py +143 -0
- spore_engine-0.1.0/spore_engine/fx/transitions.py +159 -0
- spore_engine-0.1.0/spore_engine/fx/volumetric.py +195 -0
- spore_engine-0.1.0/spore_engine/gen/__init__.py +13 -0
- spore_engine-0.1.0/spore_engine/gen/biome_terrain.py +105 -0
- spore_engine-0.1.0/spore_engine/gen/delaunay.py +173 -0
- spore_engine-0.1.0/spore_engine/gen/dungeon.py +515 -0
- spore_engine-0.1.0/spore_engine/gen/erosion.py +202 -0
- spore_engine-0.1.0/spore_engine/gen/fractals.py +171 -0
- spore_engine-0.1.0/spore_engine/gen/lsystem.py +87 -0
- spore_engine-0.1.0/spore_engine/gen/marching_cubes.py +394 -0
- spore_engine-0.1.0/spore_engine/gen/maze.py +144 -0
- spore_engine-0.1.0/spore_engine/gen/pathfinding.py +140 -0
- spore_engine-0.1.0/spore_engine/gen/scenery.py +292 -0
- spore_engine-0.1.0/spore_engine/gen/splines.py +98 -0
- spore_engine-0.1.0/spore_engine/gen/terrain.py +152 -0
- spore_engine-0.1.0/spore_engine/gen/wfc.py +202 -0
- spore_engine-0.1.0/spore_engine/media/__init__.py +5 -0
- spore_engine-0.1.0/spore_engine/media/_pillow_compat.py +24 -0
- spore_engine-0.1.0/spore_engine/media/ansi_io.py +175 -0
- spore_engine-0.1.0/spore_engine/media/converter.py +264 -0
- spore_engine-0.1.0/spore_engine/media/export.py +378 -0
- spore_engine-0.1.0/spore_engine/media/ffmpeg.py +225 -0
- spore_engine-0.1.0/spore_engine/media/glyphart.py +326 -0
- spore_engine-0.1.0/spore_engine/media/imaging.py +110 -0
- spore_engine-0.1.0/spore_engine/media/img3d.py +201 -0
- spore_engine-0.1.0/spore_engine/media/video.py +287 -0
- spore_engine-0.1.0/spore_engine/render3d/__init__.py +7 -0
- spore_engine-0.1.0/spore_engine/render3d/engine3d.py +250 -0
- spore_engine-0.1.0/spore_engine/render3d/isometric.py +91 -0
- spore_engine-0.1.0/spore_engine/render3d/model_loader.py +127 -0
- spore_engine-0.1.0/spore_engine/render3d/raytracer.py +386 -0
- spore_engine-0.1.0/spore_engine/render3d/sdf.py +231 -0
- spore_engine-0.1.0/spore_engine/render3d/voxel.py +100 -0
- spore_engine-0.1.0/spore_engine/sim/__init__.py +9 -0
- spore_engine-0.1.0/spore_engine/sim/cellular.py +277 -0
- spore_engine-0.1.0/spore_engine/sim/fluid.py +261 -0
- spore_engine-0.1.0/spore_engine/sim/noise.py +248 -0
- spore_engine-0.1.0/spore_engine/sim/physics.py +988 -0
- spore_engine-0.1.0/spore_engine/sim/physics3d.py +194 -0
- spore_engine-0.1.0/spore_engine/sim/powder.py +447 -0
- spore_engine-0.1.0/spore_engine/sim/softbody.py +238 -0
- spore_engine-0.1.0/spore_engine/sim/steering.py +228 -0
- spore_engine-0.1.0/spore_engine/ui/__init__.py +4 -0
- spore_engine-0.1.0/spore_engine/ui/font.py +113 -0
- spore_engine-0.1.0/spore_engine/ui/tilemap.py +194 -0
- spore_engine-0.1.0/spore_engine/ui/toolkit.py +476 -0
- spore_engine-0.1.0/spore_engine/ui/widgets.py +819 -0
- spore_engine-0.1.0/spore_engine.egg-info/PKG-INFO +342 -0
- spore_engine-0.1.0/spore_engine.egg-info/SOURCES.txt +248 -0
- spore_engine-0.1.0/spore_engine.egg-info/dependency_links.txt +1 -0
- spore_engine-0.1.0/spore_engine.egg-info/entry_points.txt +3 -0
- spore_engine-0.1.0/spore_engine.egg-info/requires.txt +25 -0
- spore_engine-0.1.0/spore_engine.egg-info/top_level.txt +5 -0
- spore_engine-0.1.0/tests/test_anim.py +432 -0
- spore_engine-0.1.0/tests/test_api.py +57 -0
- spore_engine-0.1.0/tests/test_app.py +55 -0
- spore_engine-0.1.0/tests/test_app_lifecycle.py +181 -0
- spore_engine-0.1.0/tests/test_assets.py +124 -0
- spore_engine-0.1.0/tests/test_braille.py +453 -0
- spore_engine-0.1.0/tests/test_camera.py +47 -0
- spore_engine-0.1.0/tests/test_cli_shader.py +157 -0
- spore_engine-0.1.0/tests/test_core_canvas.py +152 -0
- spore_engine-0.1.0/tests/test_demo_platformer.py +19 -0
- spore_engine-0.1.0/tests/test_demos.py +113 -0
- spore_engine-0.1.0/tests/test_docs.py +306 -0
- spore_engine-0.1.0/tests/test_draw_primitives.py +86 -0
- spore_engine-0.1.0/tests/test_draw_sweep.py +861 -0
- spore_engine-0.1.0/tests/test_dungeon.py +431 -0
- spore_engine-0.1.0/tests/test_ecs.py +133 -0
- spore_engine-0.1.0/tests/test_fx.py +368 -0
- spore_engine-0.1.0/tests/test_geom.py +290 -0
- spore_engine-0.1.0/tests/test_import_integrity.py +97 -0
- spore_engine-0.1.0/tests/test_incremental_render.py +113 -0
- spore_engine-0.1.0/tests/test_input.py +225 -0
- spore_engine-0.1.0/tests/test_input_stream.py +710 -0
- spore_engine-0.1.0/tests/test_lightfield.py +821 -0
- spore_engine-0.1.0/tests/test_media.py +615 -0
- spore_engine-0.1.0/tests/test_noise.py +157 -0
- spore_engine-0.1.0/tests/test_optional_deps.py +327 -0
- spore_engine-0.1.0/tests/test_physics_stability.py +142 -0
- spore_engine-0.1.0/tests/test_powder.py +594 -0
- spore_engine-0.1.0/tests/test_scene.py +45 -0
- spore_engine-0.1.0/tests/test_screenfx.py +47 -0
- spore_engine-0.1.0/tests/test_shaderlab.py +392 -0
- spore_engine-0.1.0/tests/test_sim_resize.py +86 -0
- spore_engine-0.1.0/tests/test_state.py +55 -0
- spore_engine-0.1.0/tests/test_term.py +502 -0
- spore_engine-0.1.0/tests/test_toolkit.py +688 -0
- spore_engine-0.1.0/tests/test_util.py +55 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Creative Commons Legal Code
|
|
2
|
+
|
|
3
|
+
CC0 1.0 Universal
|
|
4
|
+
|
|
5
|
+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
|
6
|
+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
|
7
|
+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
|
8
|
+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
|
9
|
+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
|
10
|
+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
|
11
|
+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
|
12
|
+
HEREUNDER.
|
|
13
|
+
|
|
14
|
+
Statement of Purpose
|
|
15
|
+
|
|
16
|
+
The laws of most jurisdictions throughout the world automatically confer
|
|
17
|
+
exclusive Copyright and Related Rights (defined below) upon the creator
|
|
18
|
+
and subsequent owner(s) (each and all, an "owner") of an original work of
|
|
19
|
+
authorship and/or a database (each, a "Work").
|
|
20
|
+
|
|
21
|
+
Certain owners wish to permanently relinquish those rights to a Work for
|
|
22
|
+
the purpose of contributing to a commons of creative, cultural and
|
|
23
|
+
scientific works ("Commons") that the public can reliably and without fear
|
|
24
|
+
of later claims of infringement build upon, modify, incorporate in other
|
|
25
|
+
works, reuse and redistribute as freely as possible in any form whatsoever
|
|
26
|
+
and for any purposes, including without limitation commercial purposes.
|
|
27
|
+
These owners may contribute to the Commons to promote the ideal of a free
|
|
28
|
+
culture and the further production of creative, cultural and scientific
|
|
29
|
+
works, or to gain reputation or greater distribution for their Work in
|
|
30
|
+
part through the use and efforts of others.
|
|
31
|
+
|
|
32
|
+
For these and/or other purposes and motivations, and without any
|
|
33
|
+
expectation of additional consideration or compensation, the person
|
|
34
|
+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
|
35
|
+
is an owner of Copyright and Related Rights in the Work, voluntarily
|
|
36
|
+
elects to apply CC0 to the Work and publicly distribute the Work under its
|
|
37
|
+
terms, with knowledge of his or her Copyright and Related Rights in the
|
|
38
|
+
Work and the meaning and intended legal effect of CC0 on those rights.
|
|
39
|
+
|
|
40
|
+
1. Copyright and Related Rights. A Work made available under CC0 may be
|
|
41
|
+
protected by copyright and related or neighboring rights ("Copyright and
|
|
42
|
+
Related Rights"). Copyright and Related Rights include, but are not
|
|
43
|
+
limited to, the following:
|
|
44
|
+
|
|
45
|
+
i. the right to reproduce, adapt, distribute, perform, display,
|
|
46
|
+
communicate, and translate a Work;
|
|
47
|
+
ii. moral rights retained by the original author(s) and/or performer(s);
|
|
48
|
+
iii. publicity and privacy rights pertaining to a person's image or
|
|
49
|
+
likeness depicted in a Work;
|
|
50
|
+
iv. rights protecting against unfair competition in regards to a Work,
|
|
51
|
+
subject to the limitations in paragraph 4(a), below;
|
|
52
|
+
v. rights protecting the extraction, dissemination, use and reuse of data
|
|
53
|
+
in a Work;
|
|
54
|
+
vi. database rights (such as those arising under Directive 96/9/EC of the
|
|
55
|
+
European Parliament and of the Council of 11 March 1996 on the legal
|
|
56
|
+
protection of databases, and under any national implementation
|
|
57
|
+
thereof, including any amended or successor version of such
|
|
58
|
+
directive); and
|
|
59
|
+
vii. other similar, equivalent or corresponding rights throughout the
|
|
60
|
+
world based on applicable law or treaty, and any national
|
|
61
|
+
implementations thereof.
|
|
62
|
+
|
|
63
|
+
2. Waiver. To the greatest extent permitted by, but not in contravention
|
|
64
|
+
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
|
65
|
+
irrevocably and unconditionally waives, abandons, and surrenders all of
|
|
66
|
+
Affirmer's Copyright and Related Rights and associated claims and causes
|
|
67
|
+
of action, whether now known or unknown (including existing as well as
|
|
68
|
+
future claims and causes of action), in the Work (i) in all territories
|
|
69
|
+
worldwide, (ii) for the maximum duration provided by applicable law or
|
|
70
|
+
treaty (including future time extensions), (iii) in any current or future
|
|
71
|
+
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
|
72
|
+
including without limitation commercial, advertising or promotional
|
|
73
|
+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
|
74
|
+
member of the public at large and to the detriment of Affirmer's heirs and
|
|
75
|
+
successors, fully intending that such Waiver shall not be subject to
|
|
76
|
+
revocation, rescission, cancellation, termination, or any other legal or
|
|
77
|
+
equitable action to disrupt the quiet enjoyment of the Work by the public
|
|
78
|
+
as contemplated by Affirmer's express Statement of Purpose.
|
|
79
|
+
|
|
80
|
+
3. Public License Fallback. Should any part of the Waiver for any reason
|
|
81
|
+
be judged legally invalid or ineffective under applicable law, then the
|
|
82
|
+
Waiver shall be preserved to the maximum extent permitted taking into
|
|
83
|
+
account Affirmer's express Statement of Purpose. In addition, to the
|
|
84
|
+
extent the Waiver is so judged Affirmer hereby grants to each affected
|
|
85
|
+
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
|
86
|
+
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
|
87
|
+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
|
88
|
+
maximum duration provided by applicable law or treaty (including future
|
|
89
|
+
time extensions), (iii) in any current or future medium and for any number
|
|
90
|
+
of copies, and (iv) for any purpose whatsoever, including without
|
|
91
|
+
limitation commercial, advertising or promotional purposes (the
|
|
92
|
+
"License"). The License shall be deemed effective as of the date CC0 was
|
|
93
|
+
applied by Affirmer to the Work. Should any part of the License for any
|
|
94
|
+
reason be judged legally invalid or ineffective under applicable law, such
|
|
95
|
+
partial invalidity or ineffectiveness shall not invalidate the remainder
|
|
96
|
+
of the License, and in such case Affirmer hereby affirms that he or she
|
|
97
|
+
will not (i) exercise any of his or her remaining Copyright and Related
|
|
98
|
+
Rights in the Work or (ii) assert any associated claims and causes of
|
|
99
|
+
action with respect to the Work, in either case contrary to Affirmer's
|
|
100
|
+
express Statement of Purpose.
|
|
101
|
+
|
|
102
|
+
4. Limitations and Disclaimers.
|
|
103
|
+
|
|
104
|
+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
|
105
|
+
surrendered, licensed or otherwise affected by this document.
|
|
106
|
+
b. Affirmer offers the Work as-is and makes no representations or
|
|
107
|
+
warranties of any kind concerning the Work, express, implied,
|
|
108
|
+
statutory or otherwise, including without limitation warranties of
|
|
109
|
+
title, merchantability, fitness for a particular purpose, non
|
|
110
|
+
infringement, or the absence of latent or other defects, accuracy, or
|
|
111
|
+
the present or absence of errors, whether or not discoverable, all to
|
|
112
|
+
the greatest extent permissible under applicable law.
|
|
113
|
+
c. Affirmer disclaims responsibility for clearing rights of other persons
|
|
114
|
+
that may apply to the Work or any use thereof, including without
|
|
115
|
+
limitation any person's Copyright and Related Rights in the Work.
|
|
116
|
+
Further, Affirmer disclaims responsibility for obtaining any necessary
|
|
117
|
+
consents, permissions or other rights required for any use of the
|
|
118
|
+
Work.
|
|
119
|
+
d. Affirmer understands and acknowledges that Creative Commons is not a
|
|
120
|
+
party to this document and has no duty or obligation with respect to
|
|
121
|
+
this CC0 or use of the Work.
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spore-engine
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A library-grade ASCII (text-mode) graphics engine
|
|
5
|
+
Author: Spore Engine Authors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/spore-engine/spore-engine
|
|
8
|
+
Project-URL: Changelog, https://github.com/spore-engine/spore-engine/blob/main/CHANGELOG.md
|
|
9
|
+
Keywords: ascii,terminal,text-mode,graphics,engine
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: numpy>=1.21
|
|
23
|
+
Provides-Extra: media
|
|
24
|
+
Requires-Dist: pillow>=9.0.0; extra == "media"
|
|
25
|
+
Provides-Extra: fx
|
|
26
|
+
Requires-Dist: scipy>=1.7; extra == "fx"
|
|
27
|
+
Provides-Extra: speed
|
|
28
|
+
Requires-Dist: numba>=0.55; extra == "speed"
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: pillow>=9.0.0; extra == "all"
|
|
31
|
+
Requires-Dist: scipy>=1.7; extra == "all"
|
|
32
|
+
Requires-Dist: numba>=0.55; extra == "all"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
37
|
+
Requires-Dist: mypy>=1.5; extra == "dev"
|
|
38
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pillow>=9.0.0; extra == "dev"
|
|
40
|
+
Requires-Dist: scipy>=1.7; extra == "dev"
|
|
41
|
+
Requires-Dist: numba>=0.55; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# Spore Engine
|
|
45
|
+
|
|
46
|
+
A library-grade ASCII (text-mode) graphics engine with truecolor ANSI support, 3D rendering, physics, fluid simulation, procedural generation, cellular automata, ray tracing, and 142 demo scenes — pure Python plus `numpy`, with Pillow, SciPy, and Numba optional. Also includes image/video/GIF to ASCII conversion via ffmpeg or PIL, plus a **glyph art** module that converts media to copyable plain-text ASCII.
|
|
47
|
+
|
|
48
|
+
## Demo
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
Terminal capture of the interactive scene demos, straight from `demo.py`.
|
|
53
|
+
|
|
54
|
+
<details>
|
|
55
|
+
<summary>Full-resolution video capture (<code>demo.mp4</code>)</summary>
|
|
56
|
+
|
|
57
|
+
<video src="demo.mp4" controls width="100%"></video>
|
|
58
|
+
|
|
59
|
+
</details>
|
|
60
|
+
|
|
61
|
+
## Feature Highlights
|
|
62
|
+
|
|
63
|
+
| Subsystem | Key Components |
|
|
64
|
+
|---|---|
|
|
65
|
+
| **Simple API** | `App`, `GameSprite`, `Anim` — sprites from ASCII art, tweened animations, keyboard/mouse input, fluent chaining |
|
|
66
|
+
| **Assets & ECS** | Unified `load_sprite`/`load_palette`/`load_model`/`load_text` loaders behind a memoized `Assets` store; `World`/`System`/`Component`/`EcsEntity` game-logic ECS that draws through `SpriteRenderSystem` into Scene/Layer |
|
|
67
|
+
| **Core Rendering** | `Canvas`, `HiResCanvas` (2x vertical via half-blocks), `Color` (HSV, hex, blending, gradients), `Sprite`, `Vec2`/`Vec3`/`Mat4`, incremental per-frame flush (only changed cells re-emitted) |
|
|
68
|
+
| **3D Rendering** | `Mesh3D` with wireframe & solid shading, OBJ/PLY loader, backface culling, depth sort, light direction |
|
|
69
|
+
| **Isometric** | `IsoTile`, `IsoMap`, `IsoCamera` — tile grid with screen projection |
|
|
70
|
+
| **Voxel** | `VoxelScene` — heightmap-based 3D landscape with directional shading & fog |
|
|
71
|
+
| **Ray Tracing** | `RayScene`, `Sphere`, `Plane`, Phong shading, reflections, refraction, multiple light sources |
|
|
72
|
+
| **SDF Ray Marching** | `SDFScene`, `sd_sphere`/`sd_box`/`sd_torus`/`sd_cylinder`, CSG ops (union/subtract/intersect/smooth/repeat) |
|
|
73
|
+
| **Physics 2D** | `PhysicsWorld`, `Body`, `Spring`, `AABB`, `RectBody`, `RayCast`, `ForceField`, `DistanceJoint`, SAT collision (`PolyBody`, `CompoundBody`, `sat_collide`) |
|
|
74
|
+
| **Physics 3D** | `Body3D`, `BoxBody3D`, `Spring3D`, `PhysicsWorld3D` with gravity, rotation, bounds |
|
|
75
|
+
| **Soft Body** | `SoftBody` — pressure-based volume preservation, spring networks, circle/polygon shapes, cloth |
|
|
76
|
+
| **Steering Behaviors** | `SteerAgent`, `SteerWorld` — seek, flee, arrive, pursue, evade, wander, flock (separation/alignment/cohesion), path follow, obstacle avoidance |
|
|
77
|
+
| **Fluid Simulation** | `FluidSim` (Navier-Stokes with vorticity confinement), `WaveSim` (2D wave equation) |
|
|
78
|
+
| **Particle System** | `Particle`, `Burst`, `Emitter`, `FountainEmitter`, `StreamEmitter`, `FireEmitter` — particle life, trails, burst_explosion/burst_ring/burst_directional |
|
|
79
|
+
| **Vector Fields** | `FieldSource` (vortex/sink/source/swirl), `VectorField`, `FieldParticle`, `FieldSystem` |
|
|
80
|
+
| **2D Lighting** | `Ray2D`, `Light`, `LightManager`, `cast_ray`/`cast_ray_dda`, `visibility_polygon`, `render_shadows` |
|
|
81
|
+
| **Visual Effects** | `plasma`, `fire`, `starfield`, `matrix_rain` |
|
|
82
|
+
| **Text Effects** | 12 animations: `glitch_text`, `typewriter_text`, `sine_text`, `rainbow_text`, `gradient_text`, `scroll_text`, `star_wars_crawl`, `wave_text`, `fire_text`, `matrix_code_rain`, `bounce_text`, `zoom_text` |
|
|
83
|
+
| **Screen Effects** | `shake`, `fade_overlay`, `flash`, `crossfade`, `color_overlay` |
|
|
84
|
+
| **Post-Processing** | `box_blur`, `glow`, `edge_detect`, `dither`, `scanlines`, `vignette`, `chromatic_aberration`, `pixelate`, `palette_remap` |
|
|
85
|
+
| **Shader Pipeline** | `Shader`, `ShaderPipeline` — 16 modular shaders: `WaveDistort`, `SwirlDistort`, `KuwaharaFilter`, `Posterize`, `Solarize`, `CelShade`, `HeatHaze`, `Emboss`, `PixelSort`, `Crystallize`, `ASCIIRemap`, `ChannelShift`, `Kaleidoscope`, `Warp`, `VHSGlitch`, `Ripple` |
|
|
86
|
+
| **Scene Transitions** | `Fade`, `Wipe` (4 dirs), `Slide`, `Checkerboard`, `PixelDissolve` |
|
|
87
|
+
| **Volumetric FX** | `VolumetricFog`, `LightCone`, `SmokePlume`, `VolumetricRenderer` |
|
|
88
|
+
| **Animation** | `Tween`, `Sequence`, `Oscillator`, `Ticker`, 20+ easing functions, `Animator`, `Entity`, `Path`/`PathFollower`, `Keyframe`/`Track`/`Timeline`, IK `Bone`/`Skeleton` (FABRIK solver, arm/leg/tentacle creators) |
|
|
89
|
+
| **Procedural Gen** | `Terrain` (Perlin heightmap + island), `Maze` (DFS/Prim's), `LSystem` (stochastic too), `DungeonGen` (BSP rooms+corridors), `ErosionSim`, `WFC` (wave function collapse), fractals (`Mandelbrot`, `BurningShip`, `NewtonFractal`, `BarnsleyFern`) |
|
|
90
|
+
| **Noise** | `PerlinNoise` (2D/3D, fbm), `WorleyNoise`, `OpenSimplexNoise`, `ValueNoise` |
|
|
91
|
+
| **Cellular Automata** | `GameOfLife`, `Automata1D`, `WireWorld`, `LangtonsAnt`, `ReactionDiffusion` (Gray-Scott), 8 built-in GoL patterns |
|
|
92
|
+
| **Powder Simulation** | `PowderSim` — 12 materials (Sand/Water/Stone/Wood/Fire/Smoke/Oil/Lava/Acid/Plant/Salt/Steam), liquid/gas/solid physics, flammability, melting, erosion |
|
|
93
|
+
| **Biome Maps** | `BiomeMap` — 12 biomes from elevation/moisture/temperature (ocean, beach, desert, grassland, forest, rainforest, tundra, taiga, mountains, snow, swamp, savanna) |
|
|
94
|
+
| **Scenery** | `ParallaxScenery`, `ParallaxLayer`, `Cloud`, `CloudLayer`, `MountainProfile`, `Tree`, `WaterSurface`, `DayNightCycle` (sky/stars/moon) |
|
|
95
|
+
| **Curves & Splines** | `quadratic_bezier`, `cubic_bezier`, `catmull_rom` with rendering |
|
|
96
|
+
| **Pathfinding** | `AStar` — 4/8-directional, weighted grid, path visualization |
|
|
97
|
+
| **Delaunay / Voronoi** | `Delaunay`, `Point`, `Triangle`, circumcircle-based triangulation, Voronoi diagram rendering |
|
|
98
|
+
| **Marching Cubes** | 3D isosurface extraction to `Mesh3D` with density grid generation |
|
|
99
|
+
| **Terminal UI** | 17 widgets: `Label`, `TextBox`, `ProgressBar`, `Button`, `Menu`, `Frame`, `Checkbox`, `RadioGroup`, `TabBar`, `Slider`, `Table`, `TextField`, `Toggle`, `Divider`, `StatusBar`, `WidgetManager` + `TerminalApp` (event loop, mouse, keyboard), `Form`, `Dialog` |
|
|
100
|
+
| **TileMap** | `TileMap`, `TileCamera`, auto-tiling, collision, `generate_platformer`, `generate_cave` |
|
|
101
|
+
| **Bitmap Font** | `Font` — 5x7 character glyphs |
|
|
102
|
+
| **Media I/O** | Image/video/GIF → ASCII (`ImageConverter`, `image_to_canvas`, `video_to_ascii`), `ScreenRecorder`, `glyphart` (copyable plain-text ASCII), ANSI file I/O (parse/export/save/load), `Video`/`FramePlayer`, canvas scaling & gradient |
|
|
103
|
+
| **Demo Scenes** | 142 interactive demo scenes in `demo.py` / `demos/` |
|
|
104
|
+
| **Authoring** | `.spore` scene files (`spore new` / `run -w`), live code-shader editor (`spore shader`), `App` subsystem façade (`app.physics`, `app.particles`, `app.ecs`, ...) |
|
|
105
|
+
|
|
106
|
+
## Installation
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
|
|
110
|
+
pip install spore-engine
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Authoring: write, run, edit
|
|
115
|
+
|
|
116
|
+
The engine is not only a library you import. It has a live authoring loop.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
spore new stars # write a commented starter scene
|
|
120
|
+
spore run stars.spore -w # run it, and reload it every time you save
|
|
121
|
+
spore shader # live shader preview: edit and save, it updates
|
|
122
|
+
spore list # what scenes are here
|
|
123
|
+
spore info stars.spore # which contract does it define
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A `.spore` file is ordinary Python. Define `setup(app)`, `update(app, dt)`, or
|
|
127
|
+
both, and it is driven by the same `App` the demos use:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
# stars.spore
|
|
131
|
+
import math
|
|
132
|
+
from spore_engine import Color
|
|
133
|
+
|
|
134
|
+
_state = {'stars': []}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def setup(app):
|
|
138
|
+
_state['stars'] = [app.sprite('*', x=i * 7 % 78, y=2,
|
|
139
|
+
fg=Color(159, 216, 255))
|
|
140
|
+
for i in range(40)]
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def update(app, dt):
|
|
144
|
+
for i, s in enumerate(_state['stars']):
|
|
145
|
+
s.x = (i * 7 + app.t * 12) % 78
|
|
146
|
+
s.y = 2 + math.sin(app.t * 2 + i) * 6
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
State shared between `setup` and `update` has to live at module level — a name
|
|
150
|
+
assigned inside `setup` is local to `setup`, and `update` would raise
|
|
151
|
+
`NameError` on the first frame.
|
|
152
|
+
|
|
153
|
+
`spore run --watch` re-reads the file on save and reruns `setup`. If the file
|
|
154
|
+
has a syntax error, the running scene stays up and the error is reported — a
|
|
155
|
+
half-saved file is normal while editing.
|
|
156
|
+
|
|
157
|
+
The same applies to shaders. A shader is a program with a `draw` or `shade`
|
|
158
|
+
function, and `spore shader` previews it while you edit:
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
# plasma.spore
|
|
162
|
+
uniforms = {"scale": 0.35}
|
|
163
|
+
|
|
164
|
+
def draw(canvas, t, dt):
|
|
165
|
+
canvas.clear(' ')
|
|
166
|
+
for y in range(canvas.height):
|
|
167
|
+
for x in range(canvas.width):
|
|
168
|
+
v = math.sin(x * 0.3 + t) + math.cos(y * 0.4 - t)
|
|
169
|
+
canvas.set_pixel(x, y, SHADES[int(abs(v) * 3) % 10],
|
|
170
|
+
lerp_color(BLUE, RED, abs(v) / 2))
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`uniforms` declares values you can tweak live; they are readable inside the
|
|
174
|
+
body as `u`. The shader body is exec'd with a ready-made namespace, so `math`,
|
|
175
|
+
`Canvas`, `Color`, `Gradient`, `SHADES`, `PALETTES`, the primary colors
|
|
176
|
+
(`BLUE`, `RED`, ...), and the helpers `lerp_color`, `lerp`, `clamp`, `ramp`,
|
|
177
|
+
`wave`, `osc`, and `ir` are already in scope — no imports needed.
|
|
178
|
+
|
|
179
|
+
A shader that raises is recorded and the last good frame stays on screen, so a
|
|
180
|
+
typo dims the picture instead of blanking the terminal.
|
|
181
|
+
|
|
182
|
+
`spore shader` (or `python3 shader_sandbox.py`) is the live preview: it renders
|
|
183
|
+
at your frame rate, watches the file, and reloads on save. `e` opens
|
|
184
|
+
`$EDITOR` — the terminal is handed over for the duration, so vim and nano work
|
|
185
|
+
— and the preview resumes on return. See
|
|
186
|
+
[`wiki/usage.md`](wiki/usage.md#shader-lab) for the full key table.
|
|
187
|
+
|
|
188
|
+
## Subsystems on `App`
|
|
189
|
+
|
|
190
|
+
`App` wires the engine's subsystems in as lazy properties. Touch one and it is
|
|
191
|
+
constructed, registered for auto-update, and placed in the right render stage;
|
|
192
|
+
touch none and you pay nothing. They are ordinary objects, so the full API
|
|
193
|
+
under each one is still available.
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
from spore_engine.easy import App
|
|
197
|
+
|
|
198
|
+
app = App()
|
|
199
|
+
|
|
200
|
+
# Physics — bodies are Prop objects, and props are auto-updated
|
|
201
|
+
a = app.physics.ball('o', 10, 5, fg=0xff8844)
|
|
202
|
+
b = app.physics.ball('@', 40, 5, fg=0x88ff44)
|
|
203
|
+
app.physics.spring(a, b, stiffness=60)
|
|
204
|
+
|
|
205
|
+
app.particles.burst(5, 5, 20, colors=[0xffffff, 0x88ccff])
|
|
206
|
+
app.particles.fountain(50, 14)
|
|
207
|
+
app.field.add_vortex(10, 8, 2.0)
|
|
208
|
+
app.waves.splash(12, 8, 1.5)
|
|
209
|
+
app.fluid.splat(20, 6, 0.8)
|
|
210
|
+
|
|
211
|
+
# ECS, with chaining
|
|
212
|
+
app.ecs.entity().position(3, 4).sprite('*', fg=0xffffff)
|
|
213
|
+
|
|
214
|
+
# A live code shader. `source` is a property, so assign to it.
|
|
215
|
+
app.shaders.source = "def draw(canvas, t, dt):\n canvas.clear('.')\n"
|
|
216
|
+
app.shaders.load('my.spore') # or compile a file, reloading on save
|
|
217
|
+
|
|
218
|
+
app.tilemap(20, 8) # TileMap system
|
|
219
|
+
app.run()
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
| Property | Stage | Backed by |
|
|
223
|
+
|---|---|---|
|
|
224
|
+
| `app.physics` | background | `PhysicsWorld`, `Body`, `Spring` — `ball()` returns a `Prop` |
|
|
225
|
+
| `app.particles` | background | `ParticleSystem` — `burst`, `fountain`, `stream`, `fire` |
|
|
226
|
+
| `app.field` | background | `VectorField`, `FieldSource` — `add_vortex`/`add_sink`/`add_source`/`add_swirl` |
|
|
227
|
+
| `app.waves` | background | `WaveSim` — `splash` |
|
|
228
|
+
| `app.fluid` | background | `FluidSim` — `splat`, `push` |
|
|
229
|
+
| `app.ecs` | background | `World`/`Component` — `entity()`, `on_update(fn)`, `remove_entity` |
|
|
230
|
+
| `app.tilemap(w, h)` | background | `TileMap`, auto-tiling and collision |
|
|
231
|
+
| `app.raytrace` | background | `RayScene` — `objects` list, `render_to(hr)` |
|
|
232
|
+
| `app.sdf` | background | `SDFScene` — `add_sphere`/`add_box`/`add_torus`, `render_to` |
|
|
233
|
+
| `app.shaders` | overlay | `ShaderPipeline` plus a live `ShaderProgram` |
|
|
234
|
+
|
|
235
|
+
`app.systems` lists the bridges that have actually been constructed, in
|
|
236
|
+
creation order. Each one has `.enabled` and `.stage`, so you can turn one off or
|
|
237
|
+
move it between `BACKGROUND`, `FOREGROUND`, and `OVERLAY`.
|
|
238
|
+
|
|
239
|
+
## Quick Start
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
python3 easy_demo.py # Simple API demo (sprites, animation, input)
|
|
243
|
+
python3 demo.py # Interactive demo (142 scenes
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
```python
|
|
247
|
+
# Easy API — sprites from ASCII art, fluent animation
|
|
248
|
+
from spore_engine.easy import App, GameSprite
|
|
249
|
+
from spore_engine import Color
|
|
250
|
+
|
|
251
|
+
app = App()
|
|
252
|
+
player = GameSprite(""" @ \n /@\\ \n / \\""", x=5, y=10, fg=Color(255, 200, 100))
|
|
253
|
+
player.move_to(70, 10).over(3).ease('bounce_out')
|
|
254
|
+
app.run()
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
# Low-level API — full control
|
|
259
|
+
import sys
|
|
260
|
+
from spore_engine import Canvas, Color
|
|
261
|
+
|
|
262
|
+
c = Canvas(80, 24)
|
|
263
|
+
c.draw_text(10, 10, 'Hello Spore!', Color(255, 128, 0))
|
|
264
|
+
c.render_to(sys.stdout) # render_to wants a stream with .write
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
# Tween animation with chaining
|
|
269
|
+
from spore_engine import Tween
|
|
270
|
+
|
|
271
|
+
t = (Tween(0, 100, 2, 'bounce_out')
|
|
272
|
+
.on_update(lambda v: print(f'Value: {v:.1f}'))
|
|
273
|
+
.on_done(lambda: print('Done!'))
|
|
274
|
+
.start())
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
# Terminal GUI
|
|
279
|
+
from spore_engine.ui import TerminalApp, Label, Button
|
|
280
|
+
|
|
281
|
+
app = TerminalApp()
|
|
282
|
+
app.add(Label(5, 3, 'Hello, world!', fg=Color(0, 255, 0)))
|
|
283
|
+
app.add(Button(5, 5, 'Quit', on_click=lambda: app.stop()))
|
|
284
|
+
app.run()
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Documentation
|
|
288
|
+
|
|
289
|
+
- [`wiki/usage.md`](wiki/usage.md) — Comprehensive usage guide
|
|
290
|
+
- [`wiki/math.md`](wiki/math.md) — Vector/matrix math, rendering math, simulation math
|
|
291
|
+
- [`wiki/files.md`](wiki/files.md) — How each file contributes to the engine
|
|
292
|
+
- [`wiki/architecture.md`](wiki/architecture.md) — How everything works together
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
## Glyph Art (copyable ASCII)
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
GLYPH_IMG=~/photo.jpg python3 demo.py # scene 86 — coloured ASCII glyph art
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
```python
|
|
302
|
+
from spore_engine.media.glyphart import image_to_glyph, image_to_glyph_colored
|
|
303
|
+
|
|
304
|
+
# Plain text (copyable, no ANSI codes)
|
|
305
|
+
text = image_to_glyph('photo.jpg', width=80)
|
|
306
|
+
print(text) # ← select & copy this
|
|
307
|
+
|
|
308
|
+
# Coloured glyph data for display
|
|
309
|
+
text, colors = image_to_glyph_colored('photo.jpg', width=80)
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Requirements
|
|
313
|
+
|
|
314
|
+
- Python 3.10+ (developed and verified on Linux)
|
|
315
|
+
- `numpy` — the only required third-party package
|
|
316
|
+
- Optional: `Pillow` (image I/O), `ffmpeg` (video conversion), `SciPy` and
|
|
317
|
+
`Numba` (faster filters / JIT, both with pure-Python fallbacks)
|
|
318
|
+
- A POSIX terminal. Raw mode, `SIGWINCH` resize handling, and the mouse
|
|
319
|
+
protocol are POSIX-only; Windows is untested and unsupported.
|
|
320
|
+
|
|
321
|
+
### Colour support
|
|
322
|
+
|
|
323
|
+
The engine emits one of three output levels, selected per canvas:
|
|
324
|
+
|
|
325
|
+
| `color_depth` | Output |
|
|
326
|
+
| --- | --- |
|
|
327
|
+
| `3` (default when capable) | 24-bit truecolor |
|
|
328
|
+
| `2` | 256-colour (`38;5;n`) |
|
|
329
|
+
| `0` or `1` | plain text, no colour escapes at all |
|
|
330
|
+
|
|
331
|
+
There is **no 16-colour mode** — levels `0` and `1` both render monochrome.
|
|
332
|
+
|
|
333
|
+
Detection is automatic and honours `NO_COLOR`, `TERM=dumb`, and non-tty output
|
|
334
|
+
(output to a pipe or file is always plain). Auto-detection assumes truecolor
|
|
335
|
+
for terminal types that do not actually advertise it, so **if you are on a
|
|
336
|
+
16-colour or monochrome terminal, or a multiplexer such as tmux that is not
|
|
337
|
+
configured for truecolor, set the level yourself:**
|
|
338
|
+
|
|
339
|
+
```python
|
|
340
|
+
app.canvas.color_depth = 1 # 0 or 1 = plain, 2 = 256-colour, 3 = truecolor
|
|
341
|
+
```
|
|
342
|
+
|