aboutsummaryrefslogtreecommitdiff
path: root/physics.scm
diff options
context:
space:
mode:
Diffstat (limited to 'physics.scm')
-rw-r--r--physics.scm18
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)