aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile11
-rw-r--r--ai.scm6
-rw-r--r--animation.scm6
-rw-r--r--assets.scm2
-rw-r--r--demo/audio.scm10
-rw-r--r--demo/platformer.scm20
-rw-r--r--demo/sandbox.scm18
-rw-r--r--demo/shmup.scm14
-rw-r--r--demo/topdown.scm18
-rw-r--r--docs/api.org40
-rw-r--r--docs/guide.org24
-rw-r--r--downstroke.egg44
-rw-r--r--engine.scm10
-rw-r--r--entity.scm2
-rw-r--r--input.scm4
-rw-r--r--makedocs.el35
-rw-r--r--mixer.scm2
-rw-r--r--physics.scm8
-rw-r--r--renderer.scm8
-rw-r--r--scene-loader.scm8
-rw-r--r--sound.scm4
-rw-r--r--tests/ai-test.scm10
-rw-r--r--tests/animation-test.scm3
-rw-r--r--tests/assets-test.scm2
-rw-r--r--tests/engine-test.scm22
-rw-r--r--tests/entity-test.scm2
-rw-r--r--tests/input-test.scm4
-rw-r--r--tests/physics-test.scm12
-rw-r--r--tests/renderer-test.scm10
-rw-r--r--tests/scene-loader-test.scm22
-rw-r--r--tests/tilemap-test.scm2
-rw-r--r--tests/world-test.scm8
-rw-r--r--tilemap.scm2
-rw-r--r--world.scm6
35 files changed, 218 insertions, 184 deletions
diff --git a/.gitignore b/.gitignore
index 3021353..1f0692c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,5 @@
logs
/.agent-shell/
CLAUDE.md
-superpowers/* \ No newline at end of file
+superpowers/*
+/public \ No newline at end of file
diff --git a/Makefile b/Makefile
index 65cb33e..6327ef9 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ OBJECT_FILES := $(patsubst %,bin/%.o,$(MODULE_NAMES))
DEMO_NAMES := platformer shmup topdown audio sandbox
DEMO_BINS := $(patsubst %,bin/demo-%,$(DEMO_NAMES))
-UNIT_NAMES := $(patsubst %,downstroke/%,$(MODULE_NAMES))
+UNIT_NAMES := $(patsubst %,downstroke-%,$(MODULE_NAMES))
USES_FLAGS := $(patsubst %,-uses %,$(UNIT_NAMES))
# Build all engine modules
@@ -16,9 +16,6 @@ engine: $(OBJECT_FILES)
bin:
@mkdir -p $@
-downstroke:
- @mkdir -p $@
-
# Explicit inter-module dependencies
bin/entity.o:
bin/tilemap.o:
@@ -35,9 +32,9 @@ bin/ai.o: bin/entity.o bin/world.o
bin/scene-loader.o: bin/world.o bin/tilemap.o bin/assets.o bin/engine.o
# Pattern rule: compile each module as a library unit
-bin/%.o: %.scm | bin downstroke
- csc -c -J -unit downstroke/$* $*.scm -o bin/$*.o -I bin -L bin/downstroke
- @mkdir -p bin/downstroke && if [ -f downstroke/$*.import.scm ]; then mv downstroke/$*.import.scm bin/downstroke/; fi
+bin/%.o: %.scm | bin
+ csc -c -J -unit downstroke-$* $*.scm -o bin/$*.o -I bin
+ @if [ -f downstroke-$*.import.scm ]; then mv downstroke-$*.import.scm bin/; fi
.PHONY: clean test engine demos
diff --git a/ai.scm b/ai.scm
index e6c1ec1..9240eba 100644
--- a/ai.scm
+++ b/ai.scm
@@ -1,11 +1,11 @@
-(module downstroke/ai *
+(module downstroke-ai *
(import scheme
(chicken base)
(chicken keyword)
(only srfi-1 find)
states
- downstroke/entity
- downstroke/world)
+ downstroke-entity
+ downstroke-world)
;; Patrol speed in pixels per frame
(define *patrol-speed* 1)
diff --git a/animation.scm b/animation.scm
index e6627fe..a152753 100644
--- a/animation.scm
+++ b/animation.scm
@@ -1,9 +1,9 @@
-(module downstroke/animation *
+(module downstroke-animation *
(import scheme
(chicken base)
(chicken keyword)
- downstroke/entity
- downstroke/world)
+ downstroke-entity
+ downstroke-world)
;; ---- Animation data accessors ----
diff --git a/assets.scm b/assets.scm
index 9bbbf92..fdf6ae1 100644
--- a/assets.scm
+++ b/assets.scm
@@ -1,4 +1,4 @@
-(module downstroke/assets *
+(module downstroke-assets *
(import scheme
(chicken base)
diff --git a/demo/audio.scm b/demo/audio.scm
index 8ae4d62..2cf5665 100644
--- a/demo/audio.scm
+++ b/demo/audio.scm
@@ -3,11 +3,11 @@
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
(prefix sdl2-image "img:")
- downstroke/engine
- downstroke/renderer
- downstroke/input
- downstroke/assets
- downstroke/sound)
+ downstroke-engine
+ downstroke-renderer
+ downstroke-input
+ downstroke-assets
+ downstroke-sound)
(define *music-on?* #f)
diff --git a/demo/platformer.scm b/demo/platformer.scm
index 2d30bea..09f9b56 100644
--- a/demo/platformer.scm
+++ b/demo/platformer.scm
@@ -3,16 +3,16 @@
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
(prefix sdl2-image "img:")
- downstroke/engine
- downstroke/world
- downstroke/tilemap
- downstroke/renderer
- downstroke/input
- downstroke/physics
- downstroke/assets
- downstroke/entity
- downstroke/sound
- downstroke/scene-loader)
+ downstroke-engine
+ downstroke-world
+ downstroke-tilemap
+ downstroke-renderer
+ downstroke-input
+ downstroke-physics
+ downstroke-assets
+ downstroke-entity
+ downstroke-sound
+ downstroke-scene-loader)
(define *game*
(make-game
diff --git a/demo/sandbox.scm b/demo/sandbox.scm
index ffc0cca..f585a6a 100644
--- a/demo/sandbox.scm
+++ b/demo/sandbox.scm
@@ -4,15 +4,15 @@
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
(prefix sdl2-image "img:")
- downstroke/engine
- downstroke/world
- downstroke/tilemap
- downstroke/renderer
- downstroke/input
- downstroke/physics
- downstroke/assets
- downstroke/entity
- downstroke/scene-loader)
+ downstroke-engine
+ downstroke-world
+ downstroke-tilemap
+ downstroke-renderer
+ downstroke-input
+ downstroke-physics
+ downstroke-assets
+ downstroke-entity
+ downstroke-scene-loader)
(define *elapsed* 0)
(define *respawn-interval* 10000)
diff --git a/demo/shmup.scm b/demo/shmup.scm
index 19cc478..8610d4d 100644
--- a/demo/shmup.scm
+++ b/demo/shmup.scm
@@ -5,13 +5,13 @@
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
(prefix sdl2-image "img:")
- downstroke/engine
- downstroke/world
- downstroke/physics
- downstroke/input
- downstroke/entity
- downstroke/assets
- downstroke/sound)
+ downstroke-engine
+ downstroke-world
+ downstroke-physics
+ downstroke-input
+ downstroke-entity
+ downstroke-assets
+ downstroke-sound)
(define *frame-count* 0)
diff --git a/demo/topdown.scm b/demo/topdown.scm
index b95ccc9..2b3c208 100644
--- a/demo/topdown.scm
+++ b/demo/topdown.scm
@@ -3,15 +3,15 @@
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
(prefix sdl2-image "img:")
- downstroke/engine
- downstroke/world
- downstroke/tilemap
- downstroke/renderer
- downstroke/input
- downstroke/physics
- downstroke/assets
- downstroke/entity
- downstroke/scene-loader)
+ downstroke-engine
+ downstroke-world
+ downstroke-tilemap
+ downstroke-renderer
+ downstroke-input
+ downstroke-physics
+ downstroke-assets
+ downstroke-entity
+ downstroke-scene-loader)
(define *game*
(make-game
diff --git a/docs/api.org b/docs/api.org
index 0a443d6..3925bc2 100644
--- a/docs/api.org
+++ b/docs/api.org
@@ -2,10 +2,10 @@
This document describes the public API for the Downstroke game engine. All exported functions are organized by module.
-* Engine (~downstroke/engine~)
+* Engine (~downstroke-engine~)
#+begin_src scheme
-(import downstroke/engine)
+(import downstroke-engine)
#+end_src
The engine module provides the top-level game lifecycle and state management.
@@ -135,10 +135,10 @@ Transitions to a named state, activating its lifecycle hooks. Calls the state's
(game-start-state! my-game 'paused)
#+end_src
-* World (~downstroke/world~)
+* World (~downstroke-world~)
#+begin_src scheme
-(import downstroke/world)
+(import downstroke-world)
#+end_src
The world module provides the scene (level) abstraction and camera management.
@@ -268,10 +268,10 @@ Returns a list of all entities whose ~#:tags~ list contains the given tag. Retur
- ~scene-camera~, ~scene-camera-set!~
- ~scene-tileset-texture~, ~scene-tileset-texture-set!~
-* Entity (~downstroke/entity~)
+* Entity (~downstroke-entity~)
#+begin_src scheme
-(import downstroke/entity)
+(import downstroke-entity)
#+end_src
The entity module provides property list (plist) accessors for game objects. Entities are immutable plists, never modified in place.
@@ -354,10 +354,10 @@ All entities can have these keys. Not all are required:
| ~#:anim-frame~ | integer | Current frame index |
| ~#:anim-tick~ | integer | Ticks in current frame |
-* Physics (~downstroke/physics~)
+* Physics (~downstroke-physics~)
#+begin_src scheme
-(import downstroke/physics)
+(import downstroke-physics)
#+end_src
The physics module implements the main collision and movement pipeline. The physics pipeline runs automatically before the user's ~update:~ hook.
@@ -469,10 +469,10 @@ Applies ~resolve-entity-collisions~ to the scene's entity list. Returns the modi
- ~*gravity*~ = 1 (pixels per frame per frame)
- ~*jump-force*~ = 15 (vertical acceleration on jump)
-* Input (~downstroke/input~)
+* Input (~downstroke-input~)
#+begin_src scheme
-(import downstroke/input)
+(import downstroke-input)
#+end_src
The input module handles keyboard, joystick, and game controller events. It maintains the current and previous input state to support pressed/released detection.
@@ -536,10 +536,10 @@ Initializes an input state record from a configuration. All actions start as unp
player)))
#+end_src
-* Renderer (~downstroke/renderer~)
+* Renderer (~downstroke-renderer~)
#+begin_src scheme
-(import downstroke/renderer)
+(import downstroke-renderer)
#+end_src
The renderer module provides SDL2 drawing abstractions.
@@ -584,10 +584,10 @@ Returns an SDL2 flip list based on the entity's ~#:facing~ field. Returns ~'(hor
Renders a single line of text to the screen at the given pixel coordinates. ~color~ is an SDL2 color struct. Positions are in screen (viewport) space, not world space. Does not cache; call once per frame for each text element.
-* Assets (~downstroke/assets~)
+* Assets (~downstroke-assets~)
#+begin_src scheme
-(import downstroke/assets)
+(import downstroke-assets)
#+end_src
The assets module provides a simple registry for game resources.
@@ -629,10 +629,10 @@ Retrieves a value from the registry by key. Returns ~#f~ if not found.
(sdl2:make-color 255 255 255) 10 10)))
#+end_src
-* Sound (~downstroke/sound~)
+* Sound (~downstroke-sound~)
#+begin_src scheme
-(import downstroke/sound)
+(import downstroke-sound)
#+end_src
The sound module provides music and sound effect playback via SDL_mixer.
@@ -708,10 +708,10 @@ Changes the music volume while it is playing. ~volume~ is 0.0 to 1.0.
Releases all audio resources. Call at shutdown or in a cleanup hook.
-* Animation (~downstroke/animation~)
+* Animation (~downstroke-animation~)
#+begin_src scheme
-(import downstroke/animation)
+(import downstroke-animation)
#+end_src
The animation module provides simple frame-based sprite animation.
@@ -753,10 +753,10 @@ Example:
Converts a frame index to a tile ID (1-indexed). Used internally by ~animate-entity~.
-* Scene Loader (~downstroke/scene-loader~)
+* Scene Loader (~downstroke-scene-loader~)
#+begin_src scheme
-(import downstroke/scene-loader)
+(import downstroke-scene-loader)
#+end_src
The scene-loader module provides utilities for loading Tiled maps and instantiating entities from prefabs.
diff --git a/docs/guide.org b/docs/guide.org
index 5119cea..af6319e 100644
--- a/docs/guide.org
+++ b/docs/guide.org
@@ -42,7 +42,7 @@ chicken-install downstroke sdl2 sdl2-image defstruct matchable states
Create a file called =mygame.scm=:
#+begin_src scheme
-(import downstroke/engine)
+(import downstroke-engine)
(define *game*
(make-game title: "Hello World" width: 640 height: 480))
@@ -66,10 +66,10 @@ Now let's add an entity you can move with the keyboard. Create =square.scm=:
(import scheme
(chicken base)
(prefix sdl2 "sdl2:")
- downstroke/engine
- downstroke/world
- downstroke/entity
- downstroke/input)
+ downstroke-engine
+ downstroke-world
+ downstroke-entity
+ downstroke-input)
(define *game*
(make-game
@@ -138,13 +138,13 @@ For a real game, you probably want tilemaps, gravity, and collision detection. D
#+begin_src scheme
(import scheme
(chicken base)
- downstroke/engine
- downstroke/world
- downstroke/entity
- downstroke/input
- downstroke/physics
- downstroke/scene-loader
- downstroke/sound)
+ downstroke-engine
+ downstroke-world
+ downstroke-entity
+ downstroke-input
+ downstroke-physics
+ downstroke-scene-loader
+ downstroke-sound)
(define *game*
(make-game
diff --git a/downstroke.egg b/downstroke.egg
index 8f7dea2..216f864 100644
--- a/downstroke.egg
+++ b/downstroke.egg
@@ -5,38 +5,38 @@
(category games)
(dependencies sdl2 sdl2-image sdl2-ttf expat defstruct srfi-1 srfi-13 srfi-197 matchable simple-logger)
(components
- (extension downstroke/entity
+ (extension downstroke-entity
(source "entity.scm"))
- (extension downstroke/tilemap
+ (extension downstroke-tilemap
(source "tilemap.scm"))
- (extension downstroke/world
+ (extension downstroke-world
(source "world.scm")
- (component-dependencies downstroke/entity downstroke/tilemap))
- (extension downstroke/physics
+ (component-dependencies downstroke-entity downstroke-tilemap))
+ (extension downstroke-physics
(source "physics.scm")
- (component-dependencies downstroke/entity downstroke/tilemap downstroke/world))
- (extension downstroke/input
+ (component-dependencies downstroke-entity downstroke-tilemap downstroke-world))
+ (extension downstroke-input
(source "input.scm")
- (component-dependencies downstroke/entity))
- (extension downstroke/assets
+ (component-dependencies downstroke-entity))
+ (extension downstroke-assets
(source "assets.scm"))
- (extension downstroke/renderer
+ (extension downstroke-renderer
(source "renderer.scm")
- (component-dependencies downstroke/entity downstroke/tilemap downstroke/world))
- (extension downstroke/engine
+ (component-dependencies downstroke-entity downstroke-tilemap downstroke-world))
+ (extension downstroke-engine
(source "engine.scm")
- (component-dependencies downstroke/renderer downstroke/world downstroke/input downstroke/assets))
- (extension downstroke/mixer
+ (component-dependencies downstroke-renderer downstroke-world downstroke-input downstroke-assets))
+ (extension downstroke-mixer
(source "mixer.scm"))
- (extension downstroke/sound
+ (extension downstroke-sound
(source "sound.scm")
- (component-dependencies downstroke/mixer))
- (extension downstroke/animation
+ (component-dependencies downstroke-mixer))
+ (extension downstroke-animation
(source "animation.scm")
- (component-dependencies downstroke/entity downstroke/world))
- (extension downstroke/ai
+ (component-dependencies downstroke-entity downstroke-world))
+ (extension downstroke-ai
(source "ai.scm")
- (component-dependencies downstroke/entity downstroke/world))
- (extension downstroke/scene-loader
+ (component-dependencies downstroke-entity downstroke-world))
+ (extension downstroke-scene-loader
(source "scene-loader.scm")
- (component-dependencies downstroke/world downstroke/tilemap downstroke/assets downstroke/engine))))
+ (component-dependencies downstroke-world downstroke-tilemap downstroke-assets downstroke-engine))))
diff --git a/engine.scm b/engine.scm
index 69a30c7..783f259 100644
--- a/engine.scm
+++ b/engine.scm
@@ -1,4 +1,4 @@
-(module downstroke/engine *
+(module downstroke-engine *
(import scheme
(chicken base)
@@ -8,10 +8,10 @@
(prefix sdl2-image "img:")
(srfi 69)
defstruct
- downstroke/world
- downstroke/input
- downstroke/assets
- downstroke/renderer)
+ downstroke-world
+ downstroke-input
+ downstroke-assets
+ downstroke-renderer)
;; ── Game struct ────────────────────────────────────────────────────────────
;; defstruct auto-generates make-game, which we'll wrap with default values
diff --git a/entity.scm b/entity.scm
index 3b12e2e..8e8011f 100644
--- a/entity.scm
+++ b/entity.scm
@@ -1,4 +1,4 @@
-(module downstroke/entity
+(module downstroke-entity
*
(import scheme
(chicken base)
diff --git a/input.scm b/input.scm
index e6b8940..94b29ed 100644
--- a/input.scm
+++ b/input.scm
@@ -1,4 +1,4 @@
-(module downstroke/input
+(module downstroke-input
*
(import scheme
@@ -9,7 +9,7 @@
(only srfi-197 chain)
(prefix sdl2 sdl2:)
simple-logger
- downstroke/entity
+ downstroke-entity
defstruct)
;; Input configuration record
diff --git a/makedocs.el b/makedocs.el
new file mode 100644
index 0000000..6675092
--- /dev/null
+++ b/makedocs.el
@@ -0,0 +1,35 @@
+(require 'ox-publish)
+
+;; 1. Define the project paths relative to this script
+(setq project-root (file-name-directory (or load-file-name buffer-file-name)))
+(setq org-notes-dir (expand-file-name "docs/" project-root))
+(setq public-dir (expand-file-name "public/" project-root))
+
+;; 2. Set up the publishing configuration
+(setq org-publish-project-alist
+ `(("project-docs"
+ :base-directory ,org-notes-dir
+ :base-extension "org"
+ :publishing-directory ,public-dir
+ :recursive t
+ :publishing-function org-html-publish-to-html
+ :headline-levels 4
+ :auto-preamble t
+ ;; This ensures ReadTheOrg works correctly
+ :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css\"/>
+ <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"></script>
+ <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js\"></script>
+ <script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js\"></script>"
+ :html-head-extra "<link rel='stylesheet' type='text/css' href='https://gongzhitaao.org/orgcss/org.css'/>")
+ ("project-static"
+ :base-directory ,org-notes-dir
+ :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf"
+ :publishing-directory ,public-dir
+ :recursive t
+ :publishing-function org-publish-attachment)
+ ("all" :components ("project-docs" "project-static"))))
+
+;; 3. The magic command to build everything
+(org-publish-all t)
+
+(message "Build complete!")
diff --git a/mixer.scm b/mixer.scm
index e1c563a..7491635 100644
--- a/mixer.scm
+++ b/mixer.scm
@@ -1,4 +1,4 @@
-(module downstroke/mixer *
+(module downstroke-mixer *
(import scheme
(chicken base)
(chicken foreign))
diff --git a/physics.scm b/physics.scm
index 68a96d6..06cb12c 100644
--- a/physics.scm
+++ b/physics.scm
@@ -1,12 +1,12 @@
-(module downstroke/physics *
+(module downstroke-physics *
(import scheme
(chicken base)
(chicken keyword)
(only srfi-1 fold iota)
defstruct
- downstroke/tilemap
- downstroke/entity
- downstroke/world
+ downstroke-tilemap
+ downstroke-entity
+ downstroke-world
simple-logger)
;; Gravity constant: pixels per frame per frame
diff --git a/renderer.scm b/renderer.scm
index 0a82c67..28c7079 100644
--- a/renderer.scm
+++ b/renderer.scm
@@ -1,13 +1,13 @@
-(module downstroke/renderer
+(module downstroke-renderer
*
(import scheme
(chicken base)
(only srfi-1 iota for-each)
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
- downstroke/entity
- downstroke/tilemap
- downstroke/world)
+ downstroke-entity
+ downstroke-tilemap
+ downstroke-world)
;; --- Pure functions (no SDL2, testable) ---
diff --git a/scene-loader.scm b/scene-loader.scm
index 519622e..f00cbce 100644
--- a/scene-loader.scm
+++ b/scene-loader.scm
@@ -1,4 +1,4 @@
-(module downstroke/scene-loader *
+(module downstroke-scene-loader *
(import scheme
(chicken base)
(only srfi-1 filter-map)
@@ -6,9 +6,9 @@
(prefix sdl2 "sdl2:")
(prefix sdl2-ttf "ttf:")
defstruct
- downstroke/tilemap
- downstroke/world
- downstroke/engine)
+ downstroke-tilemap
+ downstroke-world
+ downstroke-engine)
;; Create a prefab registry from alternating symbol/constructor pairs.
;; Returns a srfi-69 hash-table mapping symbols to constructor functions.
diff --git a/sound.scm b/sound.scm
index a0bb945..983386f 100644
--- a/sound.scm
+++ b/sound.scm
@@ -1,8 +1,8 @@
-(module downstroke/sound *
+(module downstroke-sound *
(import scheme
(chicken base)
(only srfi-1 for-each)
- downstroke/mixer)
+ downstroke-mixer)
(define *sound-registry* '())
(define *music* #f)
diff --git a/tests/ai-test.scm b/tests/ai-test.scm
index 9bb3d28..02a9806 100644
--- a/tests/ai-test.scm
+++ b/tests/ai-test.scm
@@ -1,5 +1,5 @@
;; Mock entity module for testing
-(module downstroke/entity *
+(module downstroke-entity *
(import scheme (chicken base) (chicken keyword))
(define (entity-ref entity key #!optional default)
(get-keyword key entity (if (procedure? default) default (lambda () default))))
@@ -12,18 +12,18 @@
(define (entity-type e) (entity-ref e #:type #f)))
;; Mock world module for testing
-(module downstroke/world *
+(module downstroke-world *
(import scheme (chicken base))
(define (scene-entities s) s)
(define (scene-find-tagged scene tag) #f))
(import (srfi 64)
states
- downstroke/entity
- downstroke/world)
+ downstroke-entity
+ downstroke-world)
(include "ai.scm")
-(import downstroke/ai)
+(import downstroke-ai)
(test-begin "ai")
diff --git a/tests/animation-test.scm b/tests/animation-test.scm
index fefb77f..e12b35b 100644
--- a/tests/animation-test.scm
+++ b/tests/animation-test.scm
@@ -1,8 +1,9 @@
(import srfi-64)
(include "entity.scm")
+(include "tilemap.scm")
(include "world.scm")
(include "animation.scm")
-(import downstroke/entity downstroke/world downstroke/animation)
+(import downstroke-entity downstroke-world downstroke-animation)
(test-begin "animation")
diff --git a/tests/assets-test.scm b/tests/assets-test.scm
index 0f6931b..c7b26f0 100644
--- a/tests/assets-test.scm
+++ b/tests/assets-test.scm
@@ -1,7 +1,7 @@
(import srfi-64)
(include "assets.scm")
-(import downstroke/assets)
+(import downstroke-assets)
(test-begin "assets")
diff --git a/tests/engine-test.scm b/tests/engine-test.scm
index 99bb12f..79b475e 100644
--- a/tests/engine-test.scm
+++ b/tests/engine-test.scm
@@ -38,7 +38,7 @@
(import (prefix sdl2-image "img:"))
;; --- Entity module (mock minimal structs) ---
-(module downstroke/entity *
+(module downstroke-entity *
(import scheme (chicken base))
(define (entity-ref entity key #!optional (default #f))
(let loop ((plist entity))
@@ -46,10 +46,10 @@
((null? plist) (if (procedure? default) (default) default))
((eq? (car plist) key) (cadr plist))
(else (loop (cddr plist)))))))
-(import downstroke/entity)
+(import downstroke-entity)
;; --- Input module (mock) ---
-(module downstroke/input *
+(module downstroke-input *
(import scheme (chicken base) defstruct)
(defstruct input-config
actions keyboard-map joy-button-map controller-button-map
@@ -75,12 +75,12 @@
state)
(define (input-held? state action)
#f))
-(import downstroke/input)
+(import downstroke-input)
;; --- World module (mock) ---
-(module downstroke/world *
+(module downstroke-world *
(import scheme (chicken base) defstruct)
- (import downstroke/entity)
+ (import downstroke-entity)
(defstruct camera x y)
(defstruct scene entities tilemap camera tileset-texture camera-target)
;; Mock camera-follow! - just clamps camera position
@@ -94,22 +94,22 @@
((null? entities) #f)
((member tag (entity-ref (car entities) #:tags '())) (car entities))
(else (loop (cdr entities)))))))
-(import downstroke/world)
+(import downstroke-world)
;; --- Real deps ---
(import simple-logger) ;; required by input.scm
(include "assets.scm")
-(import downstroke/assets)
+(import downstroke-assets)
;; --- Renderer module (mock) ---
-(module downstroke/renderer *
+(module downstroke-renderer *
(import scheme (chicken base))
(define (render-scene! . args) #f))
-(import downstroke/renderer)
+(import downstroke-renderer)
;; --- Engine module (real) ---
(include "engine.scm")
-(import downstroke/engine)
+(import downstroke-engine)
;; --- Tests ---
diff --git a/tests/entity-test.scm b/tests/entity-test.scm
index d67e0ff..5df8e76 100644
--- a/tests/entity-test.scm
+++ b/tests/entity-test.scm
@@ -1,6 +1,6 @@
(import srfi-64)
(include "entity.scm")
-(import downstroke/entity)
+(import downstroke-entity)
(test-begin "entity")
diff --git a/tests/input-test.scm b/tests/input-test.scm
index 7eae12f..2173f61 100644
--- a/tests/input-test.scm
+++ b/tests/input-test.scm
@@ -12,12 +12,12 @@
;; Load entity first (input imports it)
(include "entity.scm")
-(import downstroke/entity)
+(import downstroke-entity)
;; Load the module source directly
(include "input.scm")
;; Now import it to access the exported functions
-(import downstroke/input)
+(import downstroke-input)
;; Test suite for input module
(test-begin "input-module")
diff --git a/tests/physics-test.scm b/tests/physics-test.scm
index 0a2c92b..858dec8 100644
--- a/tests/physics-test.scm
+++ b/tests/physics-test.scm
@@ -7,7 +7,7 @@
(only srfi-1 every member make-list fold iota))
;; Create a mock tilemap module to avoid SDL dependency
-(module downstroke/tilemap *
+(module downstroke-tilemap *
(import scheme (chicken base) defstruct)
(defstruct tileset
@@ -35,23 +35,23 @@
layers
objects))
-(import downstroke/tilemap)
+(import downstroke-tilemap)
;; Load entity module first (since world now imports entity)
(include "entity.scm")
-(import downstroke/entity)
+(import downstroke-entity)
;; Load world module first
(include "world.scm")
-(import downstroke/world)
+(import downstroke-world)
;; Load physics module
(include "physics.scm")
-(import downstroke/physics)
+(import downstroke-physics)
;; Load physics module
(include "input.scm")
-(import downstroke/input)
+(import downstroke-input)
;; Test suite for physics module
(test-begin "physics-module")
diff --git a/tests/renderer-test.scm b/tests/renderer-test.scm
index d14f12c..fc5c8f2 100644
--- a/tests/renderer-test.scm
+++ b/tests/renderer-test.scm
@@ -7,7 +7,7 @@
srfi-64)
;; Mock tilemap module
-(module downstroke/tilemap *
+(module downstroke-tilemap *
(import scheme (chicken base) defstruct)
(defstruct tileset tilewidth tileheight spacing tilecount columns image-source image)
(defstruct layer name width height map)
@@ -15,7 +15,7 @@
(defstruct tile id rect)
(define (tileset-tile ts id) (make-tile id: id rect: #f))
(define (tile-rect t) #f))
-(import downstroke/tilemap)
+(import downstroke-tilemap)
;; Mock sdl2
(module sdl2 *
@@ -35,15 +35,15 @@
;; Load entity module
(include "entity.scm")
-(import downstroke/entity)
+(import downstroke-entity)
;; Load world module
(include "world.scm")
-(import downstroke/world)
+(import downstroke-world)
;; Load renderer module
(include "renderer.scm")
-(import downstroke/renderer)
+(import downstroke-renderer)
(test-begin "renderer")
diff --git a/tests/scene-loader-test.scm b/tests/scene-loader-test.scm
index 61f142f..6a0b27c 100644
--- a/tests/scene-loader-test.scm
+++ b/tests/scene-loader-test.scm
@@ -7,7 +7,7 @@
srfi-64)
;; Mock tilemap module
-(module downstroke/tilemap *
+(module downstroke-tilemap *
(import scheme (chicken base) defstruct)
(defstruct tileset tilewidth tileheight spacing tilecount columns image-source image)
(defstruct layer name width height map)
@@ -18,10 +18,10 @@
(define (tile-rect t) #f)
(define (load-tilemap filename) (make-tilemap width: 100 height: 100 tilewidth: 16 tileheight: 16 tileset-source: "" tileset: (make-tileset tilewidth: 16 tileheight: 16 spacing: 0 tilecount: 256 columns: 16 image-source: "" image: #f) layers: '() objects: '()))
(define (load-tileset filename) (make-tileset tilewidth: 16 tileheight: 16 spacing: 0 tilecount: 256 columns: 16 image-source: "" image: #f)))
-(import downstroke/tilemap)
+(import downstroke-tilemap)
;; Mock entity module (minimal)
-(module downstroke/entity *
+(module downstroke-entity *
(import scheme (chicken base))
(define (entity-ref entity key #!optional (default #f))
(let loop ((plist entity))
@@ -37,31 +37,31 @@
(else (loop (cddr plist) (cons (cadr plist) (cons (car plist) acc)))))))
(define (entity-type entity)
(entity-ref entity #:type #f)))
-(import downstroke/entity)
+(import downstroke-entity)
;; Mock world module
-(module downstroke/world *
+(module downstroke-world *
(import scheme (chicken base) defstruct)
(defstruct camera x y)
(defstruct scene entities tilemap camera tileset-texture camera-target)
(define (scene-add-entity scene entity)
(scene-entities-set! scene (cons entity (scene-entities scene)))
scene))
-(import downstroke/world)
+(import downstroke-world)
;; Mock assets module
-(module downstroke/assets *
+(module downstroke-assets *
(import scheme (chicken base))
(define (asset-set! assets key value) #f))
-(import downstroke/assets)
+(import downstroke-assets)
;; Mock engine module
-(module downstroke/engine *
+(module downstroke-engine *
(import scheme (chicken base))
(define (game-renderer game) #f)
(define (game-asset-set! game key value) #f)
(define (game-scene-set! game scene) #f))
-(import downstroke/engine)
+(import downstroke-engine)
;; Mock sdl2
(module sdl2 *
@@ -77,7 +77,7 @@
;; Load scene-loader module
(include "scene-loader.scm")
-(import downstroke/scene-loader)
+(import downstroke-scene-loader)
(test-begin "scene-loader")
diff --git a/tests/tilemap-test.scm b/tests/tilemap-test.scm
index 47d6a51..16629bd 100644
--- a/tests/tilemap-test.scm
+++ b/tests/tilemap-test.scm
@@ -20,7 +20,7 @@
;; Load the module source directly
(include "tilemap.scm")
;; Now import it to access the exported functions
-(import downstroke/tilemap)
+(import downstroke-tilemap)
;; Test suite for tilemap module
(test-begin "tilemap-module")
diff --git a/tests/world-test.scm b/tests/world-test.scm
index 451ab2a..90c26c4 100644
--- a/tests/world-test.scm
+++ b/tests/world-test.scm
@@ -7,7 +7,7 @@
(only srfi-1 every member make-list))
;; Create a mock tilemap module to avoid SDL dependency
-(module downstroke/tilemap *
+(module downstroke-tilemap *
(import scheme (chicken base) defstruct)
(defstruct tileset
@@ -35,16 +35,16 @@
layers
objects))
-(import downstroke/tilemap)
+(import downstroke-tilemap)
;; Load entity module first (since world now imports entity)
(include "entity.scm")
-(import downstroke/entity)
+(import downstroke-entity)
;; Load the module source directly
(include "world.scm")
;; Now import it to access the exported functions
-(import downstroke/world)
+(import downstroke-world)
;; Test suite for world module
(test-begin "world-module")
diff --git a/tilemap.scm b/tilemap.scm
index 8af70b9..0335cc3 100644
--- a/tilemap.scm
+++ b/tilemap.scm
@@ -1,4 +1,4 @@
-(module downstroke/tilemap
+(module downstroke-tilemap
*
(import scheme
(chicken io)
diff --git a/world.scm b/world.scm
index 521cf13..1ca365b 100644
--- a/world.scm
+++ b/world.scm
@@ -1,11 +1,11 @@
-(module downstroke/world
+(module downstroke-world
*
(import scheme
(chicken base)
(only srfi-1 fold filter)
defstruct
- downstroke/tilemap
- downstroke/entity)
+ downstroke-tilemap
+ downstroke-entity)
;; Scene = current level: tilemap (layers, objects) + list of entities.
;; Returns tile-id if the cell at (col, row) in this layer is non-zero, #f otherwise.