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

Re: [pygame] Game Maker but with Python?



hi,

I think teaching with pygame using some existing games works out fairly well.


Here's some old lecture notes which teach python through game programming.
http://rene.f0o.com/mywiki/PythonGameProgramming



A fun course would be to start with a simple game, see how it is made
and then get people to make variations of it.

eg, you could start with a hit this moving object one and then move on wards.

A typical remake path is:
- pong, (draw graphics, take input)
- tic tac toe (basic ai)
- tetris (animation, basic gfx and sound)
- break out ()
- asteroids (vectors, collision)
- pac man (AI, levels)
- mario bros (platformer, levels, gfx)


However you could really take any games, not just those ones.  Then
explain how the game works, and then get the students to rewrite it,
or change it, to make it their own, and to show them how it is done.
The idea would be to take fairly different genres of games.

Also try and include graphic making, writing, and sound making -- not
just programming.  One project could be to come up with a simple
original game design... or even do a ludum dare game in 48 hours type
thing.  Pick names out of a hat, and get people working together in a
battle of the bands type situation.


Note, that I've seen people learn python, and get a basic tetris game
done is under 2 hours with pygame.


The simple thing about pygame is that you don't need to create new
functions, or classes to use it!  You have to *use* functions and
classes, but not make them yourself.  This makes it very good for
teaching beginners.  This is also why many people have trouble with
the pygame.sprite classes, because they are more 'frameworky' than a
library - their code calls yours, you don't call it.



Look at this... a full program without having to create a function,
class or module of your own:


import pygame, sys,os
from pygame.locals import *

pygame.init()

screen = pygame.display.set_mode((468, 60))
pygame.display.set_caption('Monkey Fever')

monkey_head_file_name = os.path.join("data","chimp.bmp")
monkey_surface = pygame.image.load(monkey_head_file_name)

screen.blit(monkey_surface, (0,0))
pygame.display.flip()

going = True
while going:
   events = pygame.event.get()
   for event in events:
      if event.type == QUIT:
         going = False
      else:
         print event




cheers,




On Thu, Oct 2, 2008 at 7:12 AM, Nathan Whitehead <nwhitehe@xxxxxxxxx> wrote:
> I just saw "100 Game Maker Games", a cool 10 minute video that shows
> the wide variety of cool games you can make with Game Maker.
>
> http://playthisthing.com/100-game-maker-games
>
> There should be something like this but with Python and pygame!
>
> My friends at UCSC have taught intro programming using Game Maker, and
> it went well but they were ultimately unhappy with GML (the Game Maker
> scripting language) as a first programming language.  When I taught
> game programming I went straight for pygame and Python (of course).
> It worked out pretty well, but the students had to spend quite a bit
> of time figuring out programming concepts before they could even get a
> square moving around on the screen.
>
> Would you use a graphical tool like Game Maker to make your games if
> it used pygame and was extensible using Python?  Why or why not?  What
> would such a tool have to do to be useful?
> --
> Nathan
>