diff options
| author | Gene Pasquet <dev@etenil.net> | 2026-04-07 19:30:08 +0100 |
|---|---|---|
| committer | Gene Pasquet <dev@etenil.net> | 2026-04-07 19:30:08 +0100 |
| commit | 618ed5fd6f5ae9c9f275c1e3cfb74762d7d51a01 (patch) | |
| tree | 0d634d79f27b97067d423c0ec1a8f62d3cd4b467 /tests/physics-test.scm | |
| parent | 78a924defabc862a7cfa5476091152c1ef5333ee (diff) | |
Added tweens
Diffstat (limited to 'tests/physics-test.scm')
| -rw-r--r-- | tests/physics-test.scm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/physics-test.scm b/tests/physics-test.scm index 67c8377..b40f8d1 100644 --- a/tests/physics-test.scm +++ b/tests/physics-test.scm @@ -592,6 +592,26 @@ (test-equal "a pushed up" -3 (entity-ref (car result) #:y 0)) (test-equal "b pushed down" 13 (entity-ref (cdr result) #:y 0))))) +(test-group "skip-pipelines" + (test-group "apply-gravity" + (let* ((e '(#:type t #:vy 0 #:gravity? #t #:skip-pipelines (gravity))) + (r (apply-gravity e))) + (test-equal "skipped: vy unchanged" 0 (entity-ref r #:vy)))) + (test-group "apply-velocity-x" + (let* ((e '(#:type t #:x 10 #:vx 5 #:skip-pipelines (velocity-x))) + (r (apply-velocity-x e))) + (test-equal "skipped: x unchanged" 10 (entity-ref r #:x)))) + (test-group "apply-jump" + (let* ((e '(#:type t #:on-ground? #t #:skip-pipelines (jump))) + (r (apply-jump e #t))) + (test-assert "skipped: no ay" (not (memq #:ay r))))) + (test-group "resolve-pair with entity-collisions skip" + (define (make-solid x y) (list #:type 'block #:x x #:y y #:width 16 #:height 16 #:solid? #t)) + (let* ((a (list #:type 'ghost #:x 0 #:y 0 #:width 16 #:height 16 #:solid? #t + #:skip-pipelines '(entity-collisions))) + (b (make-solid 10 0))) + (test-assert "no resolution" (not (resolve-pair a b)))))) + (test-group "resolve-pair" (define (make-solid x y) (list #:type 'block #:x x #:y y #:width 16 #:height 16 #:solid? #t)) |
