def draw(): """ Draws a mirror and returns it """ trans_blue = arcade.make_transparent_color( arcade.color.AIR_SUPERIORITY_BLUE, 0.66) mirror = arcade.make_soft_circle_texture(5, trans_blue, 240, 10) return mirror
def __init__(self, game_view: arcade.View, *args): super().__init__() self.game_view = game_view # Store a semitransparent color to use as an overlay self.fill_color = arcade.make_transparent_color(arcade.color.WHITE, transparency=150)
def draw_transparent_overlay(self) -> None: arcade.draw_rectangle_filled( MARGIN + SQUARE_SIZE * HORIZONTAL_SQUARES / 2 - SQUARE_SIZE / 2, MARGIN + SQUARE_SIZE * VERTICAL_SQUARES / 2 - SQUARE_SIZE / 2, SQUARE_SIZE * HORIZONTAL_SQUARES, SQUARE_SIZE * VERTICAL_SQUARES, arcade.make_transparent_color(arcade.color.TEAL, 150), )
def __init__(self, game_view: arcade.View, *args): super().__init__() self.game_view = game_view self.python_logo = load_texture(f"{IMAGES_DIR}/python_powered.png") # Store a semitransparent color to use as an overlay self.fill_color = arcade.make_transparent_color(arcade.color.WHITE, transparency=150)
def __draw_menu_pause(self): """ Disegna il menu pause :return: """ width, height = self.get_size() arcade.draw_rectangle_filled( width / 2, height / 2, width, height, arcade.make_transparent_color(arcade.color.BLACK, 100)) self.__draw_menu("PAUSE", self.__button_list_pause)
def draw_triangulation_circle(self): triangulation_strength = self.get_triangulation_strength() transparentized_color = arcade.make_transparent_color( self.color, triangulation_strength) lithium_location = self.parent.lithium_location distance_to_lithium = get_distance(self.center_x, self.center_y, *lithium_location) arcade.draw_circle_outline(self.center_x, self.center_y, distance_to_lithium, color=transparentized_color)
def __init__(self, game_view: arcade.View) -> None: """Create the pause screen""" # Initialize the parent super().__init__() # Store a reference to the underlying view self.game_view = game_view # Store a semi-transparent color to use as an overlay self.fill_color = arcade.make_transparent_color(arcade.color.WHITE, transparency=150)
def __init__(self, game_view: arcade.View, victory_sound: arcade.Sound) -> None: super().__init__() # Store a reference to the underlying view self.game_view = game_view # Play the victory sound arcade.play_sound(victory_sound) # Store a semi-transparent color to use as an overlay self.fill_color = arcade.make_transparent_color(arcade.color.WHITE, transparency=150)
def __init__(self): """ A Grid osztály tulajdonságai / tagsági változói. """ self.width = 12 self.height = 15 self.line_color = arcade.make_transparent_color(arcade.color.WHITE, 25) self.main_grid = self.create() self.test_grid = deepcopy(self.main_grid) self.active_letter = letters.choose_random_letter() self.next_letter = None self.copy_letter_to_grid() self.letter_rotation = 1 self.game_over = False self.cleared_rows = 0
def __init__(self, game_view: arcade.View): super().__init__() self.game_view = game_view # Store a semitransparent color to use as an overlay self.fill_color = arcade.make_transparent_color(arcade.color.WHITE, transparency=150) self.ui_manager = UIManager() self.viewport_coords = None # Setting up our background self.background = load_texture( f"{IMAGES_DIR}/backgrounds/backgroundColorForest.png")
def __init__(self): super().__init__(SCREEN_SIZE[0], SCREEN_SIZE[1], SCREEN_TITLE) self.planets = None self.lithium_location = get_new_lithium_location() self.last_lithium_change = time.time() self.lithium_count = 0 self.lithium_score_location = (SCREEN_SIZE[0] / 3, SCREEN_SIZE[1] / 20) self.theme = None self.background = None self.background_music = arcade.Sound(BACKGROUND_MUSIC) self.lithium_sound = arcade.Sound(LITHIUM_SOUND) self.heal_sound = arcade.Sound(HEAL_SOUND) self.abscond_sound = arcade.Sound(ABSCOND_SOUND) self.game_over_sound = arcade.Sound(GAME_OVER_SOUND) self.restart_sound = arcade.Sound(RESTART_SOUND) self.master_volume = 0.5 self.abscond_button = None self.restart_button = None self.volume_meter = None self.volume_mover = None self.player_in_tutorial = True self.game_over_time = None self.absconded = None self.player_has_clicked_lithium = False self.player_has_healed_planet = False self.banner_text = None self.banner_location = (SCREEN_SIZE[0] / 100, SCREEN_SIZE[1] / 2) self.last_banner_change = None self.story_iter = None self.volume_location = (7 * SCREEN_SIZE[0] / 8, SCREEN_SIZE[1] / 13) self.restart_location = (29 * SCREEN_SIZE[0] / 40, SCREEN_SIZE[1] / 13) self.banner_background_color = arcade.make_transparent_color( arcade.color.BLUE, 100)
def __init__(self, game_view): super().__init__() self.game_view = game_view self.fill_color = arcade.make_transparent_color(arcade.color.WHITE, transparency=90)
import arcade import random fg_star_colors = [arcade.color.WHITE, arcade.color.BABY_BLUE, arcade.color.AQUA, arcade.color.BUFF, arcade.color.ALIZARIN_CRIMSON] bg_star_colors = arcade.make_transparent_color(arcade.color.WHITE, 95) #in line 3,4 we made the stars def create_starfield(shape_list, color=arcade.color.WHITE, random_color=False): for i in range(200): x = random.randint(0, 1280) y = random.randint(0, 720) w = random.randint(1, 3) h = random.randint(1, 3) if random_color: color = random.choice(fg_star_colors) star = arcade.create_rectangle_filled(x, y, w, h, color) shape_list.append(star) class GameWindow(arcade.Window): def __init__(self, width, height, title): super().__init__(width, height, title) self.center_window() self.fg_stars1=arcade.ShapeElementList() create_starfield(self.fg_stars1, random_color=True) self.fg_stars2 = arcade.ShapeElementList() self.fg_stars2.center_y = 720 create_starfield(self.fg_stars2, random_color=True)