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

[pygame] IDEA-ALTER Game Framework



"""IDEA-ALTER Game Framework by Andy Harris from the book:
   Game Programming, The L Line, The Express Line to Learning.
   ISBN-13: 978-0-470-06822-9
   http://www.cs.iupui.edu/~aharris/pygame/""";
#Import and initialize
import pygame
pygame.init()
#Display
scr=pygame.display.set_mode((320,240))
pygame.display.set_caption("Alt-F4 = QUIT")
#Entities
bg=pygame.Surface(scr.get_size()).convert()
bg.fill((250,150,50))
fnt=pygame.font.SysFont("None",24)
lbl=fnt.render("IDEA-ALTER",1,(255,255,0))
#Action -> ALTER
################
#Assign values
clock=pygame.time.Clock()
keepGoing = True
#Loop
while keepGoing:
#Timing
    clock.tick(30)
#Events
    for evnt in pygame.event.get():
        if evnt.type==pygame.QUIT:
            keepGoing = False
#Refresh display
    scr.blit(bg,(0,0))
    scr.blit(lbl,(100,100))
    pygame.display.flip()

Happy Programming!
-- 
b h a a l u u at g m a i l dot c o m
http://www.geocities.com/ek.bhaaluu/python/index.html