summaryrefslogtreecommitdiff
path: root/examples/simple.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-11-30 20:35:57 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-11-30 20:35:57 -0500
commitcc543831dab097d79fdf8c9b4a55a4b9393ee05d (patch)
treeed4486874f01d9c6b1e45bd74a60c212f84b8a7e /examples/simple.scm
parentad818791d565560e4f6e12d02b1695fe3da844db (diff)
examples: Update a few example programs.
* examples/2048/2048: Update. * examples/animation.scm: Likewise. * examples/common.scm: Likewise. * examples/simple.scm: Likewise.
Diffstat (limited to 'examples/simple.scm')
-rw-r--r--examples/simple.scm31
1 files changed, 11 insertions, 20 deletions
diff --git a/examples/simple.scm b/examples/simple.scm
index 0fd4503..9560f6f 100644
--- a/examples/simple.scm
+++ b/examples/simple.scm
@@ -15,34 +15,25 @@
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
-(use-modules (sly camera)
- (sly game)
- (sly math rect)
- (sly render scene)
- (sly render sprite)
- (sly math transform)
- (sly vector)
+(use-modules (sly game)
(sly window)
- (sly render color))
+ (sly math vector)
+ (sly render camera)
+ (sly render group)
+ (sly render sprite))
(load "common.scm")
(define scene
- (scene-root
- (scene-node
- (position #(320 240))
- (uniforms `(("color" ,white)))
- (children
- (list (load-sprite "images/p1_front.png"))))))
+ (group-move (vector2 320 240)
+ (group (load-sprite "images/p1_front.png"))))
-(define camera
- (make-camera scene
- identity-transform
- (orthographic-projection 0 640 0 480 0 1)
- (make-rect 0 0 640 480)))
+(define camera (orthographic-camera 640 480))
+
+(add-hook! draw-hook (lambda _ (draw-group scene camera)))
(with-window (make-window #:title "Simple Sprite Demo")
- (start-game-loop camera))
+ (start-game-loop))
;;; Local Variables:
;;; compile-command: "../pre-inst-env guile simple.scm"