1
0

define a resource class for every entity that needs to be controlled on the game map

This commit is contained in:
andrea
2025-08-01 22:05:03 +02:00
parent e0dc558c27
commit a5831085ba
4 changed files with 31 additions and 25 deletions

View File

@@ -1,7 +1,8 @@
import random as _random
import uuid as _uuid
from entities import resource as _resource
class BrSimPlayer():
class BrSimPlayer(_resource.BrSimResource):
def __init__(self, name, inventory= None):
self.id= str(_uuid.uuid4())
@@ -19,18 +20,12 @@ class BrSimPlayer():
self.equipped_weapon= None
self.gender= _random.sample(['m', 'f', '-'], 1)[0] # for now get a random gender
self.reputation= 50 #Like RDR2 the player can be evil(0) or good(100). This should influence the sponsors and internal alliance
self.coord_x= 0
self.coord_y= 0
def is_player(self):
return True
### control methods
def get_player_coordinates(self):
return self.coord_x, self.coord_y
def set_player_coordinates(self, x, y):
self.coord_x= x
self.coord_y= y
def get_name_and_stats(self):
health= '♥️' * self.health or '☠️'
strength= '⚔️' * self.damage