When programming a game it is normal to use programming techniques that allow the tightest possible control over what happens on the screen, and when it happens. The architecture appropriate for such programming is the event loop: a single-threaded flow of control checks for an event, responds appropriately to it, then returns to check for the following event, and so on. There are two types of event loop.
Blocking event loops are paced by user actions; non-blocking event loops must be paced by some other method, usually calls to a real-time clock.
Game programming is usually done assuming that program performance will not be degraded by other users of the computer on which the program runs, which will, unfortunately, not be true for you, at least when you program in the undergraduate environment. (Please remember that we will run your submission in the undergraduate environment, so allow yourself time to port your sbumission, and to tune it, in the undergraduate environment.)
In addition to the event loop you will need a graphics model so that you can draw things to predictable places on the screen and get input from the mouse.
Thus, the purpose of this assignment is to give you some implementation experience with three important concepts:
In doing this assignment you start with a program that does simple
mouse/keyboard interaction, which you will find in the course directory,
/u/cs349/assignments/a1/hello.c. This program is written in C,
using the Xlib library, which implements a 2D graphics model similar to the
one described in class. You are assumed to be familiar with C programming and
I expect you to acquire information about Xlib functions you wish to use from
documentation like the following examples.
This process is quite simple: you know roughly what you want to do on the screen, and look at functions with suggestive names until you find the right one.