Commits

Anonymous committed 9728e9f

strange issues

Comments (0)

Files changed (2)

         
     def update(self, dt):
        
-        self.x, self.y = self.path(mixer.time)
-        self.x = self.x*ARENA_WIDTH
-        self.y = self.y*ARENA_HEIGHT
+        x_p, y_p = self.path(mixer.time)
+        self.x = x_p*ARENA_WIDTH
+        self.y = y_p*ARENA_HEIGHT
        
         self.rotation = self.rotation + self.rotation_speed * dt
         
         self.beat_osc =  (self.beat_osc+1) % self.every_x
         if beat and self.beat_osc==0:
             print "BEAT:", time
-            wave_size = 4
+            wave_size = 1
             beats = self.scientist.next_beats(time, self.signature)
-            beats = [beats[0], beats[16], beats[32], beats[48]]
+            #beats = [b for b in beats if b % self.every_x]
+            #beats = [beats[0], beats[16], beats[32], beats[48]]
             t = (enemy.Type.large1, enemy.Type.large2)
             #return (t, lambda t: sin(time - t), time-t)
-            def linear(ti):
-                return ((i+0.5)/wave_size, 1.0-(ti-time)/(beats[-1]-time))
-            return [(t[i%2], lambda ti: linear(ti)) for i in range(wave_size)]
+            span = beats[-1] - time
+            def linear(number,ti):
+                #print time
+                #print beats
+                #print (ti - time), span
+                value = (number*1.0/wave_size, #+ number*1.0/(wave_size*2.0), 
+                                (ti-time)/(span))
+                #print value
+                return value
+            return [(t[i%2], lambda ti: linear(i,ti)) for i in range(wave_size)]
         return []
     
     def lordover_old(self, time):