Skip to content

Commit

Permalink
fixed binning prism
Browse files Browse the repository at this point in the history
  • Loading branch information
rutra8002 committed Feb 13, 2024
1 parent 1d330fe commit 3bd3668
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions classes/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ def checkCollision(self, obj):
if obj.color != None:
rgb = obj.color
else:
path = f'images/materials/{obj.textureName}.png'
rgb = color_picker.get_colors(path)[0]
print(rgb)
if obj.textureName != None:
path = f'images/materials/{obj.textureName}.png'
rgb = color_picker.get_colors(path)[0]
print(rgb)
else:
rgb = (255, 255, 255)
for i in range(random.randint(60, 300)):
self.particle_system.add_particle(self.particle_center_x, self.particle_center_y, random.uniform(-1.5, 1.5)*obj.scale_factor, random.uniform(-1.5, 1.5)*obj.scale_factor, 220, random.randint(1, 7)*obj.scale_factor, random.randint(rgb[0]//2, rgb[0]), random.randint(rgb[1]//2, rgb[1]), random.randint(rgb[2]//2, rgb[2]), 220, 'square')
self.game.objects.remove(obj)
Expand Down

0 comments on commit 3bd3668

Please sign in to comment.