Commits

dr0id committed fbe9002

made cooling map scrolling of fire sprite faster

Comments (0)

Files changed (1)

pyweek15/gamelib/firesprite.py

     def update(self, dt):
     
         # step 4: convection (move the fire, here just simple scrolling up)
-        # buf1.scroll(self.scroll_x, self.scroll_y)
-        self.buf1.scroll(0, -1)
+        # self.buf1.scroll(self.scroll_x, self.scroll_y)
+        # self.buf1.scroll(0, -1)
         # dt = dt if dt < 0.02 else 0.02
         # # print('?? ', dt, self.scroll_pos_y)
         # self.scroll_pos_y += self.scroll_y * dt
 
         self.cooling_scroll_pos += 1
         self.cooling_scroll_pos %= self.cool_h
-        buf2_blit(self.cooling_map, ( 0, 0), pygame.Rect(0, self.cooling_scroll_pos, self.cool_w, self.cool_h - 1 - self.cooling_scroll_pos), BLEND_RGBA_SUB)
-        buf2_blit(self.cooling_map, ( 0, self.cool_h - 1 - self.cooling_scroll_pos), pygame.Rect(0, 0, self.cool_w, self.cooling_scroll_pos), BLEND_RGBA_SUB)
+        # buf2_blit(self.cooling_map, ( 0, 0), pygame.Rect(0, self.cooling_scroll_pos, self.cool_w, self.cool_h - 1 - self.cooling_scroll_pos), BLEND_RGBA_ADD)
+        # buf2_blit(self.cooling_map, ( 0, self.cool_h - 1 - self.cooling_scroll_pos), pygame.Rect(0, 0, self.cool_w, self.cooling_scroll_pos), BLEND_RGBA_ADD)
+        buf2_blit(self.cooling_map, ( 0, -self.cooling_scroll_pos), None, BLEND_RGBA_SUB)
+        buf2_blit(self.cooling_map, ( 0, self.cool_h - 1 - self.cooling_scroll_pos), None, BLEND_RGBA_SUB)
 
         # swap
         self.buf2, self.buf1 = self.buf1, self.buf2