def create(self, tile: tiles.Tile, texture: str, scale: int = 1) -> None: ''' Creates new static object on specified tile with chosen texture. ''' new_object = StaticMapObject() new_object.texture = texture new_object.sprite = arcade.Sprite(texture, scale) new_object.size = (new_object.sprite.height, new_object.sprite.width) new_object.bottom = random.random() + tile.y new_object.sprite.bottom = int(new_object.bottom * tile.size) new_object.left = random.random() + tile.x new_object.sprite.left = int(new_object.left * tile.size) new_object.tiles = self.game_map.get_tiles( (int(new_object.bottom), int(new_object.left)), (int(new_object.bottom + new_object.size[0] / tile.size), int(new_object.left + new_object.size[1] / tile.size))) for tile in new_object.tiles: if tile.entity != None: return None for tile in new_object.tiles: tile.entity = new_object self.sprite_list.append(new_object.sprite) self.static_objects_list.append(new_object)