summaryrefslogtreecommitdiff
path: root/doc/chickadee.texi
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-04-21 22:23:13 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-04-21 22:23:13 -0400
commit08283ce8448f9ebf6be28fecf8c730e9f99e3f47 (patch)
treede460786949318848d2b710e65f767ee3495d587 /doc/chickadee.texi
parentb4daa495779da4cfc80f00a642648143cbf313b6 (diff)
Add syntax highlighting to html manual.
Diffstat (limited to 'doc/chickadee.texi')
-rw-r--r--doc/chickadee.texi20
1 files changed, 10 insertions, 10 deletions
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}