Skip to content

Commit

Permalink
moved gun object, added object types
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Parks committed May 29, 2021
1 parent bb30112 commit 6ce92fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion game/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class ObjectType:
player = 2
game_board = 3
map_object = 4
gun = 5
item = 5
gun = 6

class GunType:
none = 0
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion game/common/items/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class Item(MapObject):
def __init__(self, coordinates, hitbox, health=None, count = 1):
super().__init__(health, coordinates, hitbox, True)
self.object_type = ObjectType.item
self.count = count

def to_json(self):
Expand All @@ -12,4 +13,4 @@ def to_json(self):

def from_json(self, data):
super().from_json(data)
self.count = data['count']
self.count = data['count']

0 comments on commit 6ce92fa

Please sign in to comment.