Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo D. Arce S <rodolfo.arce.s@gmail.com>2011-05-12 01:07:05 (GMT)
committer Rodolfo D. Arce S <rodolfo.arce.s@gmail.com>2011-05-12 01:07:05 (GMT)
commit49f1cb6c2f49ad9690ba4a77b4933ed0eabc8e70 (patch)
tree343c1cfd46b85cd8ec766b697c91cb9e2d0cd387
parent70c8775379ec44abd70839569bad6657490d8118 (diff)
Added image for background, added comments of images authors, set garbage image
-rw-r--r--README9
-rw-r--r--images/park.pngbin135754 -> 0 bytes
-rw-r--r--images/park_1.pngbin0 -> 124958 bytes
-rw-r--r--main.py29
4 files changed, 31 insertions, 7 deletions
diff --git a/README b/README
index db9cdf8..d5e0e30 100644
--- a/README
+++ b/README
@@ -1,3 +1,12 @@
Rodolfo D. Arce S.
This game is design to make children aware of the damages to the enviroment we do when we throw garbage.
+
+
+Images:
+Background:
+Me
+Robot:
+http://www.openclipart.org/detail/102925
+Paper:
+http://www.openclipart.org/detail/16727
diff --git a/images/park.png b/images/park.png
deleted file mode 100644
index e721909..0000000
--- a/images/park.png
+++ /dev/null
Binary files differ
diff --git a/images/park_1.png b/images/park_1.png
new file mode 100644
index 0000000..9963daa
--- /dev/null
+++ b/images/park_1.png
Binary files differ
diff --git a/main.py b/main.py
index 51eb83e..b5b3211 100644
--- a/main.py
+++ b/main.py
@@ -8,20 +8,29 @@ from pygame.locals import *
pygame.init()
# Screen size
-window_h = 472
-window_w = 608
+window_h = 600
+window_w = 800
screen = pygame.display.set_mode((window_w, window_h))
-object_background = pygame.image.load('images/park.png')
+# Background image
+object_background = pygame.image.load('images/park_1.png')
screen.blit(object_background, (0, 0))
+# Garbage image
+object_garbage = pygame.image.load('images/paper.png')
+position_garbage = [ 400, 300 ]
+screen.blit(object_garbage, position_garbage)
+
+# Robot image
object_robot = pygame.image.load('images/robot.png')
-screen.blit(object_robot, (300,200))
+position_robot = [0, window_h - object_robot.get_height()]
+screen.blit(object_robot, position_robot)
+
# Initialize images
pygame.display.update()
-object_position = [0,0]
+position_garbage = [0,0]
start_time = time.time()
fps = 30
frame_time = 1.0/fps
@@ -41,7 +50,13 @@ while not exit:
break
if exit:
break
-
-pygame.display.update()
+
+ current_time = time.time()
+ if current_time - start_time <= frame_time:
+ continue
+ start_time = current_time
+
+
+ pygame.display.update()
pygame.quit()