refac: update food color and food data format
This commit is contained in:
parent
035b84a480
commit
97308464c0
|
@ -63,18 +63,15 @@ class Food(pygame.sprite.Sprite):
|
||||||
self.angle = 0
|
self.angle = 0
|
||||||
|
|
||||||
def update(self) -> None:
|
def update(self) -> None:
|
||||||
self.angle += 10
|
pass
|
||||||
if self.angle > 360:
|
|
||||||
self.angle -= 360
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def game_object_data(self):
|
def game_object_data(self):
|
||||||
return {"type": "rect",
|
return create_rect_view_data(
|
||||||
"name": "ball",
|
"food",
|
||||||
"x": self.rect.x,
|
self.rect.x,
|
||||||
"y": self.rect.y,
|
self.rect.y,
|
||||||
"angle": 0,
|
self.rect.width,
|
||||||
"width": self.rect.width,
|
self.rect.height,
|
||||||
"height": self.rect.height,
|
self.color
|
||||||
"color": self.color
|
)
|
||||||
}
|
|
Loading…
Reference in New Issue