diff options
author | David Thompson <dthompson2@worcester.edu> | 2018-08-20 20:22:44 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2018-08-23 08:01:11 -0400 |
commit | eceae08c4f6985c3cc30191ab33b22302578b81e (patch) | |
tree | ead018aabef22bbd0097df991f6a900bc7b93883 /examples | |
parent | 89ed33ac799b9b55b4694c46f8e19a24d343e99b (diff) |
math: vector: Add read syntax.
* chickadee/math/vector.scm (read-vec): New procedure. Extend reader.
* examples/lines.scm: Use new vector read syntax.
* examples/nine-patch.scm: Ditto.
* examples/sprite.scm: Ditto.
* examples/text.scm: Ditto.
* examples/tiled.scm: Ditto.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/lines.scm | 4 | ||||
-rw-r--r-- | examples/nine-patch.scm | 2 | ||||
-rw-r--r-- | examples/sprite.scm | 2 | ||||
-rw-r--r-- | examples/text.scm | 6 | ||||
-rw-r--r-- | examples/tiled.scm | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/examples/lines.scm b/examples/lines.scm index 5e800e0..75aadf1 100644 --- a/examples/lines.scm +++ b/examples/lines.scm @@ -8,8 +8,8 @@ (define lines (list-tabulate 48 (lambda (n) - (list (vec2 (random 640) (random 480)) - (vec2 (random 640) (random 480)) + (list #v((random 640) (random 480)) + #v((random 640) (random 480)) (make-color (random:uniform) (random:uniform) (random:uniform) diff --git a/examples/nine-patch.scm b/examples/nine-patch.scm index ed03cab..2852245 100644 --- a/examples/nine-patch.scm +++ b/examples/nine-patch.scm @@ -14,6 +14,6 @@ (define (draw alpha) (draw-nine-patch image (make-rect 192.0 192.0 256.0 96.0) #:margin 6) - (draw-text font "I am error." (vec2 200.0 266.0))) + (draw-text font "I am error." #v(200.0 266.0))) (run-game/sdl #:load load #:draw draw) diff --git a/examples/sprite.scm b/examples/sprite.scm index 12a9ffb..8e54f21 100644 --- a/examples/sprite.scm +++ b/examples/sprite.scm @@ -9,6 +9,6 @@ (set! sprite (load-image "images/chickadee.png"))) (define (draw alpha) - (draw-sprite sprite (vec2 256.0 176.0))) + (draw-sprite sprite #v(256.0 176.0))) (run-game/sdl #:load load #:draw draw) diff --git a/examples/text.scm b/examples/text.scm index fd299b7..74c2301 100644 --- a/examples/text.scm +++ b/examples/text.scm @@ -9,11 +9,11 @@ (define (draw alpha) (draw-text font "(draw-text font \"Hello, world!\" (vec2 100.0 200.0))" - (vec2 100.0 200.0)) + #v(100.0 200.0)) (draw-text font "Chickadee is a game development toolkit for Guile Scheme." - (vec2 100.0 150.0)) + #v(100.0 150.0)) (draw-text font "The quick brown fox jumps over the lazy dog" - (vec2 100.0 100.0))) + #v(100.0 100.0))) (define (key-press key scan modifiers repeat?) (when (eq? key 'q) diff --git a/examples/tiled.scm b/examples/tiled.scm index 3d33052..b5fb8b6 100644 --- a/examples/tiled.scm +++ b/examples/tiled.scm @@ -5,7 +5,7 @@ (ice-9 match)) (define map #f) -(define camera (vec2 0.0 0.0)) +(define camera #v(0.0 0.0)) (define (load) (set! map (load-tile-map "maps/example.tmx"))) |