Racquet Game Programming

I want to use a racket to create a game whose graphics will include a grid in which each cell can be filled with one or more sprites on top of each other. Racket has graphics and a set of gui tools in its standard library, which is very nice. But apart from the official documentation, I can’t find anything about using the library in practice, and more importantly, I can’t find anything when rendering the output of the drawing library in the graphical interface so that it can actually interact with it.

Are there any good resources for this (books, blog posts, screencasts), or at least a decent open source project that I can look at to get a feel for it?

+7
source share
2 answers

One thing you can start playing with is the new "planet dear," which is included in the recently released version 5.2.1. Then you can go to the implementation to see how you can connect your own images. From there it should be easier to go to the common gui interface.

Alternatively, you can become more serious and use the allegro package for full-screen games.

+5
source

I wrote a very rude and dirty example that can help you get started: see How to create a GUI using Lisp: DrScheme or Common Lisp . The example includes just enough to have a simple timer loop and a key handler that doesn't do much yet.

What you might want to see is the racket/draw library, which includes the standard image primitives you expect from a set of drawing tools. overview shows how to draw using the drawing context . My example has a function called paint! which uses a window on the screen as a picture canvas.

As for blogs, I have not seen too much. I will try to keep my eyes clean and update this answer when I find things. There are clues that Realm of Racket will talk about game programming, but I don’t know if it will be good. :)

+3
source

All Articles