generated from mwc/project_game
Allow knife to slice into fruit
This commit is contained in:
@@ -17,6 +17,7 @@ class FruitPiece:
|
||||
self.position = position
|
||||
self.color = color
|
||||
self.z = z
|
||||
self.parent = None
|
||||
|
||||
class Fruit:
|
||||
display = False
|
||||
@@ -67,6 +68,7 @@ class Fruit:
|
||||
x, y = self.position
|
||||
ox, oy = offset
|
||||
piece = FruitPiece((x + ox, y + oy), self.color, z)
|
||||
piece.parent = self
|
||||
self.pieces[offset] = piece
|
||||
game.add_agent(piece)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user