Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorRodolfo D. Arce S <rodolfo.arce.s@gmail.com>2011-05-18 21:09:23 (GMT)
committer Rodolfo D. Arce S <rodolfo.arce.s@gmail.com>2011-05-18 21:09:23 (GMT)
commitdecfae19d747f765de74647dc07f82f65e8ab776 (patch)
tree3e1ae6a5a4c4778c16a941942c50077bd5eea93e /main.py
parentfffcd35aef9e2a499549d4fbda5cf397e5351a7d (diff)
Added separated class for tree object and a few lines regarding position and drawing
Diffstat (limited to 'main.py')
-rw-r--r--main.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/main.py b/main.py
index da06551..c6699d8 100644
--- a/main.py
+++ b/main.py
@@ -1,13 +1,21 @@
import pygame
from pygame import K_ESCAPE
from random import randint
-
+from tree import Tree
+
window_h = 640
window_w = 480
+
screen = pygame.display.set_mode( (window_h, window_w) )
pygame.display.set_caption("Ranger")
-# Tree size
+tree = Tree(screen, window_h, window_w, (window_h/2, window_w/2), 15, 20, 20)
+
+# Tree
+global tree_color
+global bg_color
+tree_color = [51, 204, 0]
+bg_color = [204, 102, 0]
tree_height = tree_width = 40
tree_radius = 15
@@ -23,12 +31,11 @@ while True:
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), tree_radius, 0)
+
+ #pygame.draw.circle(screen, tree_color, (window_h/2, window_w/2), tree_radius, 0)
#pygame.display.update()