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-06-02 23:06:05 (GMT)
committer Rodolfo D. Arce S <rodolfo.arce.s@gmail.com>2011-06-02 23:06:05 (GMT)
commit140331b74d0b6c50175f9b77a1bc15a7386345a4 (patch)
treee26e24097095232fbe3c7e9530bea14173eaf711
parent4423bd10c3b2a83c998cc3e2f72cc7df1565a0be (diff)
Improved movement for cutting trees
-rw-r--r--main.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.py b/main.py
index 610e013..26a2f73 100644
--- a/main.py
+++ b/main.py
@@ -39,6 +39,7 @@ ranger = Ranger(window_h, window_w, ranger_speed)
# Cutter
cutter_time = 100
+tree_cutting_time = 100
cutter_speed = 4
cutter = []
@@ -107,12 +108,14 @@ while True:
for arbol in trees:
for cortador in cutter:
if cortador.collides_with(arbol):
- trees.remove(arbol)
+ cortador.cut_trees = True
+ tree_cutting_time += 1
+ if cortador.cut_trees == True and tree_cutting_time == 100:
+ trees.remove(arbol)
- if cutter_time == 100:
+ if cutter_time == 300:
cutter.append( Cutter(window_h, window_w, cutter_speed) )
cutter_time = 0
-
cutter_time += 1
for arbol in trees: