[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] tool for teaching/learning programming



[originally sent to a less technically oriented mailinglist]

hi,

i've written a 2d robotwar game engine i use for programming lessons.
maybe others on this list also find the code helpful when trying to
teach programming.

a beta is available here: http://soniq.net/~paul/pyrobots-0.0c.tgz

the engine is written in python, and currently i'd consider it usable,
but incomplete (and lacking documentation). the core of the engine is very
hackish, but the interface provided to bot-writers is clean and simple
(cooperative multitasking instead of event oriented, which makes it easier
for beginners)

the basic idea is to first play a bot that takes userinput(keyboard)
and after understanding how you would play the game, you can write your
own bot to play for you, and compete against other bots (in online arenas).

the game uses simple textfiles as maps.

example:

70
#######################################
#                                     #
#                    T                #
#                                     #
#          t                          #
#                 T                   #
#                                     #
#                    t                #
#                 0              t    #
#   1                       t         #
#                                     #
#     T                               #
#                                     #
#                                     #
#######################################

#'s are walls
0 is player 1
1 is player 2
T is a treasure worth 25 points
t is a treasure worth 10 points

in this map the player who first gathers 70 points wins.

the engine can visualize what is happening both in text (like above),
or graphically (using pygame, right now lacking a pretty tileset)

maps can be arbitrarily sized. the graphical view atm scales with size,
but in the future might do scrolling (doesn't make sense before network
support is in, though)

more complex levels (think pacman, sokoban, ...) are planned for the future,
different game modes (fog of war, powerups, ...) and network support too.

nothing's set in stone yet though, i'll see what modes make the game most fun
and understandable to inexperienced programmers and newcomers, and improve
on that.

lg,
  paul