Astroids are now randomly generated every 100 frames. astroidgenerator
Astroids are now randomly generated every 100 frames.

--- a/astroids.py
+++ b/astroids.py
@@ -178,17 +178,20 @@
     def __init__(self,game):
         super(AstroidGenerator,self).__init__(game)
 
-        self.count=0
+        self.count=100
 
     def predraw(self,event):
+        self.count=max(0,self.count-1)
         if self.count==0:
-            self.new_astroid()
-            self.count+=1
-
-
-    def new_astroid(self):
+            position=random.uniform(-50,50)
+            self.new_astroid(position)
+
+
+    def new_astroid(self,position):
+        self.count=100
+
         astroidDef=b2BodyDef(type=b2_dynamicBody)
-        astroidDef.position=(0,20)
+        astroidDef.position=(position,40)
         astroidDef.linearVelocity=(0,-5)
 
         astroidPolygon=self.generate_astroid_polygon(1)