Commits

Anonymous committed 5544493

basically works and looks quite nice

  • Participants
  • Parent commits 991e8d7

Comments (0)

Files changed (1)

File code_swarm.py

 RANDOM_MOVEMENT = 0.5
 
 #: Speed towards the partner. They move this part of their distance together each step. 
-SPEED_TOWARDS_PARTNER = 0.02
+SPEED_TOWARDS_PARTNER = 0.01
 
 # Speed of partner repulsion; multiplied with the INVERSE distance. 
 SPEED_AWAY_FROM_PARTNER = 10
 INACTIVITY_OPACITY_REDUCTION = 100
 
 #: How much teh blobs should fade out per frame
-OPACITY_REDUCTION_PER_FRAME = 6
+OPACITY_REDUCTION_PER_FRAME = 2
 
 #### Imports ####
 
             print d
             return [(time(), d[0][1], d[0][2])]
         # if we have no data left, build new data.
+
+        # adjust the timing for elements.
+        if not self.downloads:
+            return []
+        self.delay_between_items += time() - self.last_access_time
+        if self.downloads[1:]:
+            self.delay_between_items /= 2
+
         #: the return data to build
         data = []
 
-        # adjust the timing for elements.
-        start_time = time()
-        while not self.downloads:
-            sleep(0.1)
-        stop_time = time()
-        wait_time = stop_time - start_time
-        self.delay_between_items += wait_time
-        if self.downloads[1:]:
-            self.delay_between_items /= 2
-
         # get the identica data
         d = self.downloads[0]
         self.downloads.remove(d)
 		x, y = self.get_starting_position()
                 if filepath.startswith("@") and not " " in filepath: # heuristic to recognize a name
                     author = Author(scene=self, name=filepath, x=x, y=y)#, batch=self.author_batch)
-                    author.color = (200, 50, 50, author.color[3])
+                    author.color = (200, 100, 100, author.color[3])
                     self.blobs[filepath] = author
                 else:
                     f = File(scene=self, name=filepath, x=x, y=y)#, batch=self.file_batch)