[plt-scheme] program online game

From: David Storrs (david.storrs at gmail.com)
Date: Tue Oct 13 11:58:10 EDT 2009

> On Tue, 13 Oct 2009 16:32:37 +0200
> Brecht Van Laethem <brvlaeth at vub.ac.be> wrote:
>
>> I can't find how you can put an image on a specific position on the screen.

The simplest, easiest way to do this is to build the board as a
full-screen table where each table cell corresponds to one square on
the Stratego board.  The table as a whole will have a very large
transparent background image of the Stratego board (the water, etc).
Squares (i.e. table cells) with pieces in them will have a background
image of the piece in question which will overlay the table's
background. Moving the pawns consists of selecting the pawn you want
to move, then selecting the square you want to move to.  The page will
then be refreshed with the images in new places that represent the new
state of the board.

If you really want to support drag-and-drop moving of pieces, updates
that don't require full refresh, and other "eye-candy", then I suggest
you look into jQuery, or one of its competitors (YUI, Dojo, etc).  I
would suggest, however, that you get the game logic working with the
method I describe above and then go back and implement the eye-candy.

--Dks


Posted on the users mailing list.