diff options
author | Rodolfo D. Arce S <rodolfo.arce.s@gmail.com> | 2011-05-12 00:37:18 (GMT) |
---|---|---|
committer | Rodolfo D. Arce S <rodolfo.arce.s@gmail.com> | 2011-05-12 00:37:18 (GMT) |
commit | 72c6638fc8dac5ac67f8ec6c9a6b42974f776b85 (patch) | |
tree | cf8bc9eb4a770133ae81bd8d2a9b8e6cdab21714 |
First commit
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | main.py | 47 |
2 files changed, 50 insertions, 0 deletions
@@ -0,0 +1,3 @@ +Rodolfo D. Arce S. + +This game is design to make children aware of the damages to the enviroment we do when we throw garbage. @@ -0,0 +1,47 @@ +# Robot saving nature + +import pygame +import time + +from pygame.locals import * + +pygame.init() + +# Screen size +window_h = 472 +window_w = 608 +screen = pygame.display.set_mode((window_w, window_h)) + +object_background = pygame.image.load('images/park.png') +screen.blit(object_background, (0, 0)) + +object_robot = pygame.image.load('images/robot.png') +screen.blit(object_robot, (300,200)) + +# Initialize images +pygame.display.update() + +object_position = [0,0] +start_time = time.time() +fps = 30 +frame_time = 1.0/fps + + + +# Main loop +exit = False + +while not exit: + # Process pygame events + for event in pygame.event.get(): + # Escape key to quit the game + if event.type == pygame.QUIT or \ + (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE): + exit = True + break + if exit: + break + +pygame.display.update() + +pygame.quit() |