import os
import sys
import pygame
from pygame import *
def main():
pygame.init()
ecran = pygame.display.set_mode((640, 480))
ruleaza= True
action = "Help!"
while ruleaza is True:
for event in pygame.event.get():
if event.type == QUIT:
ruleaza == False
elif event.type == KEYDOWN:
if event.key == K_ESCAPE:
ruleaza = False
elif event.key == K_LEFT:
action="L"
elif event.key == K_RIGHT:
action="R"
print action
main()
windows,linux, tutorials, tutorial, pygame, ,development,programming,source code,code,example,examples,All with pygame python module. The pygame-catalin is a blog created by Catalin George Festila.
marți, 17 februarie 2009
PyGame : Keyboard on pygame
This is a short example of how to use the keyboard in pygame.
Posted by
Cătălin George Feștilă
Labels:
2009,
pygame,
python,
python module,
source code,
tutorial,
tutorials
Abonați-vă la:
Postări (Atom)