From 08283ce8448f9ebf6be28fecf8c730e9f99e3f47 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 21 Apr 2023 22:23:13 -0400 Subject: Add syntax highlighting to html manual. --- doc/chickadee.texi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'doc/chickadee.texi') diff --git a/doc/chickadee.texi b/doc/chickadee.texi index a87a346..84d7a92 100644 --- a/doc/chickadee.texi +++ b/doc/chickadee.texi @@ -99,10 +99,10 @@ Chickadee depends on the following packages: One of the simplest programs we can make with Chickadee is rendering the text ``Hello, world'' on screen. Here's what that looks like: -@example +@lisp (define (draw alpha) (draw-text "Hello, world!" (vec2 64.0 240.0))) -@end example +@end lisp The @code{draw} procedure is called frequently to draw the game scene. For the sake of simplicity, we will ignore the @code{alpha} variable @@ -116,7 +116,7 @@ chickadee play hello.scm This is a good start, but it's boring. Let's make the text move! -@example +@lisp (define position (vec2 0.0 240.0)) (define (draw alpha) @@ -124,7 +124,7 @@ This is a good start, but it's boring. Let's make the text move! (define (update dt) (set-vec2-x! position (+ (vec2-x position) (* 100.0 dt)))) -@end example +@end lisp The @code{vec2} type is used to store 2D coordinates (@pxref{Vectors}.) A variable named @code{position} contains the @@ -140,7 +140,7 @@ This is neat, but after a few seconds the text moves off the screen completely, never to be seen again. It would be better if the text bounced back and forth against the sides of the window. -@example +@lisp (define position (vec2 0.0 240.0)) (define (draw alpha) @@ -159,7 +159,7 @@ bounced back and forth against the sides of the window. (while #t (tween duration start end update-x) (tween duration end start update-x)))) -@end example +@end lisp This final example uses Chickadee's scripting features (@pxref{Scripting}) to bounce the text between the edges of the window @@ -355,12 +355,12 @@ let's get back to reality. To get started with bundling, simply add a @file{bundle.scm} file to the root of the project directory. It could look something like this: -@example +@lisp '((asset-directories . ("images" "models")) (bundle-name . "the-legend-of-emacs-1.0") (code . "the-legend-of-emacs.scm") (launcher-name . "the-legend-of-emacs")) -@end example +@end lisp To create the bundle, simply run @command{chickadee bundle}. Upon success, the file @file{the-legend-of-emacs-1.0.tar.gz} would be @@ -465,7 +465,7 @@ Then, in the game loop's update procedure, call @code{poll-coop-repl-server} and pass the REPL object. Here is a template to follow: -@example +@lisp (use-modules (chickadee) (system repl coop-server)) @@ -476,7 +476,7 @@ template to follow: ...) (run-game #:update update ...) -@end example +@end lisp To use the REPL, connect to it via port 37146. Telnet will do the trick, but using the @uref{https://www.nongnu.org/geiser/, Geiser} -- cgit v1.2.3