diff options
| author | Gene Pasquet <dev@etenil.net> | 2026-04-18 05:49:34 +0100 |
|---|---|---|
| committer | Gene Pasquet <dev@etenil.net> | 2026-04-18 05:49:34 +0100 |
| commit | c2085be2dd2a0cb3da05991847e35080915e547e (patch) | |
| tree | e89a0f3c347b3106b15b69b09dcf29f93a7ef627 /physics.scm | |
| parent | 38eee24832fe6da4f135cae455881ab97953b23a (diff) | |
rename modules
Diffstat (limited to 'physics.scm')
| -rw-r--r-- | physics.scm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/physics.scm b/physics.scm index 543e786..92e50dc 100644 --- a/physics.scm +++ b/physics.scm @@ -1,4 +1,4 @@ -(module downstroke-physics +(module (downstroke physics) (resolve-entity-collisions resolve-pair aabb-overlap? push-apart push-along-axis aabb-overlap-on-axis @@ -14,9 +14,9 @@ (chicken keyword) (only srfi-1 any fold iota) defstruct - downstroke-tilemap - downstroke-entity - downstroke-world + (downstroke tilemap) + (downstroke entity) + (downstroke world) simple-logger) ;; Gravity constant: pixels per frame per frame @@ -30,7 +30,7 @@ ;; If |vy| is above this, another entity does not count as ground (mid-air / fast fall). (define *entity-ground-vy-max* 12) -;; Per-entity steps use define-pipeline from downstroke-entity (see docs/physics.org +;; Per-entity steps use define-pipeline from (downstroke entity) (see docs/physics.org ;; for #:skip-pipelines symbol names). ;; Consume #:ay into #:vy and clear it (one-shot acceleration) @@ -64,10 +64,10 @@ (y (entity-ref entity #:y 0)) (vx (entity-ref entity #:vx 0)) (vy (entity-ref entity #:vy 0)) - (e (if (downstroke-entity#entity-skips-pipeline? entity 'velocity-x) + (e (if (downstroke.entity#entity-skips-pipeline? entity 'velocity-x) entity (entity-set entity #:x (+ x vx)))) - (e (if (downstroke-entity#entity-skips-pipeline? entity 'velocity-y) + (e (if (downstroke.entity#entity-skips-pipeline? entity 'velocity-y) e (entity-set e #:y (+ (entity-ref e #:y 0) vy))))) e)) @@ -284,8 +284,8 @@ ;; Returns (a2 . b2) with positions/velocities adjusted, or #f if no collision. ;; #:immovable? #t marks static geometry; only the other entity is displaced. (define (resolve-pair a b) - (and (not (downstroke-entity#entity-skips-pipeline? a 'entity-collisions)) - (not (downstroke-entity#entity-skips-pipeline? b 'entity-collisions)) + (and (not (downstroke.entity#entity-skips-pipeline? a 'entity-collisions)) + (not (downstroke.entity#entity-skips-pipeline? b 'entity-collisions)) (entity-ref a #:solid? #f) (entity-ref b #:solid? #f) (aabb-overlap? (entity-ref a #:x 0) (entity-ref a #:y 0) |
