Im using Ursina to try and make a little idle clicker game but the background sprites I made with
background2 = Entity(position=(2, 0, 0), scale=11, color=color.blue, model='quad')
background1 = Entity(position=(-2, 0, 0), scale=11, color=color.green, model='quad')
get created before the Tile object,
class Tile(Button):
def __init__(self, position=(0, 0), tile_type="", status="", contents="", **kwargs):
super().__init__(
parent=scene,
model='quad',
color=color.azure,
texture='lib/grass.png',
highlight_color=color.red,
position=position,
**kwargs
)
self.tile_type = tile_type
self.status = status
self.contents = contents
if self.tile_type == "sell":
self.color = color.green
def on_click(self):
global selected_tile
selected_tile = self
print(f'Tile at {self.position} clicked!')
self.color = color.red
def update(self):
global selected_tile
if selected_tile != self:
if self.tile_type == "sell":
self.color = color.green
else: self.color = color.azure
but only when I change the color in the code, with the current colors its fine but if I try to set it to brown it doesnt work. Whole program in next message.