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-18 18:43:18 (GMT)
committer Rodolfo D. Arce S <rodolfo.arce.s@gmail.com>2011-05-18 18:43:18 (GMT)
commitfd4b139b54ed2af1d3b7190ca387cd9fa22eadc6 (patch)
tree4df9c21c47fc2611106f1538c8d027b5d80da8e7
parentb196efe8c21bccfdc17df6f08cf8f88c92fab0f2 (diff)
Added screen size and first sketch of trees
-rw-r--r--main.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..8768a54
--- /dev/null
+++ b/main.py
@@ -0,0 +1,29 @@
+import pygame
+from pygame import K_ESCAPE
+from random import randint
+
+window_h = 640
+window_w = 480
+screen = pygame.display.set_mode( (window_h, window_w) )
+pygame.display.set_caption("Ranger")
+#clock = pygame.time.Clock()
+
+while True:
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ exit()
+
+ keyboard = pygame.key.get_pressed()
+ if keyboard[K_ESCAPE]:
+ exit()
+
+ # Draw background
+ bg_color = [204, 102, 0]
+ screen.fill(bg_color)
+
+ # Draw everything on top of that
+ tree_color = [51, 204, 0]
+ pygame.draw.circle(screen, tree_color, (window_h/2, window_w/2), 10, 0)
+
+ pygame.display.update()
+ #clock.tick(60)