Exemple #1
0
def draw_lines():

    arcade.open_window(900,900, "lines demo")
    arcade.set_background_color(arcade.color.WHITE)


    width = arcade.get_window().width
    height = arcade.get_window().height

    arcade.start_render()


    for location in range(80, width, 80):
        arcade.draw_line(location, 0, location, height, arcade.color.BLACK, 2)









    arcade.finish_render()
    arcade.run()
    def update(self, center_x, center_y, percentage):

        current_screen_width = arcade.get_window().width
        current_screen_height = arcade.get_window().height


        self.center_x = center_x -  1280 + (self.scale * 1280 * percentage)
        self.center_y = center_y - 720 / 2 + self.y_height
def main():

    initialize()

    arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Circles")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.get_window().push_handlers(keys)
    arcade.schedule(on_draw, 1 / 80)
    arcade.run()
def powerup(sprite):
    flash = SquareSprite()
    flash.color = arcade.color.GOLD
    flash.position = sprite.position

    target = (sprite.center_x, sprite.center_y + 100)
    seq = Sequence()
    seq[0].frame = KeyFrame.from_sprite(sprite, ['position', 'scale', 'alpha'])
    seq[1].frame = KeyFrame(position=target, scale=1.5, alpha=0)
    seq[1].callback = flash.kill

    arcade.get_window().curtains.current_scene.flash_sprites.append(flash)
    return flash, seq
Exemple #5
0
    def on_click(self) -> None:
        """
        This callback will be triggered if the Clickable is pressed, focused, and MOUSE_RELEASE event is triggered.

        In case of multiple UIElements are overlapping, the last added to UIManager will be focused on MOUSE_RELEASE,
        so that only that one will trigger on_click.

        Starts the game by transitioning to the game view.
        """
        super().on_click()

        game_view = GameView()
        arcade.get_window().show_view(game_view)
Exemple #6
0
def arcadeloop():
    arcade.open_window(800, 800, "Vertical Pattern")
    arcade.set_background_color(arcade.color.WHITE)
    width = arcade.get_window().width
    height = arcade.get_window().height

    arcade.start_render()
    # start drawing here
    for x in range(0, 801, 80):
        arcade.draw_rectangle_filled(x, 400, 40, height, arcade.color.BLACK)

    arcade.finish_render()

    arcade.run()
    def on_show(self):

        self.window = arcade.get_window()

        self.draw_restart_button_hover = False

        self.hovering = False
        self.clicking = False

        self.old_screen_center_x = int(self.window.get_size()[0] / 2)
        self.old_screen_center_y = int(self.window.get_size()[1] / 2)
        self.screen_center_x = int(self.window.get_size()[0] / 2)
        self.screen_center_y = int(self.window.get_size()[1] / 2)

        win_text = 'You Won! You Got More Coins Then On The Bar-Round!'
        self.game_over_text = arcade.draw_text(win_text, self.screen_center_x, self.screen_center_y + 150,
                                           anchor_x='center',
                                           anchor_y='center', color=arcade.csscolor.WHITE, font_size=32, font_name='fonts/RobotoMono-Regular.ttf')
        win_text = f'You had a stunning {self.coins} coins! Can you beat it?'
        self.game_over_text2 = arcade.draw_text(win_text, self.screen_center_x, self.screen_center_y + 100,
                                               anchor_x='center',
                                               anchor_y='center', color=arcade.csscolor.WHITE, font_size=32,
                                               font_name='fonts/RobotoMono-Regular.ttf')

        play_again_text = 'Play Again'
        self.restart_button = arcade.draw_text(play_again_text, self.screen_center_x, self.screen_center_y,
                                                               anchor_x='center', anchor_y='center',
                                                               color=arcade.csscolor.WHITE, font_size=64, font_name='fonts/RobotoMono-Regular.ttf')

        arcade.set_background_color([66, 245, 212, 255])

        arcade.set_viewport(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT)
Exemple #8
0
def draw_rectangle_filled(center_x: float, center_y: float, width: float,
                          height: float, color: Color,
                          tilt_angle: float = 0):
    """
    Draw a filled-in rectangle.

    :param float center_x: x coordinate of rectangle center.
    :param float center_y: y coordinate of rectangle center.
    :param float width: width of the rectangle.
    :param float height: height of the rectangle.
    :param Color color: color, specified in a list of 3 or 4 bytes in RGB or
         RGBA format.
    :param float tilt_angle: rotation of the rectangle. Defaults to zero.
    """
    window = get_window()
    if not window:
        raise RuntimeError("No window found")

    ctx = window.ctx

    program = ctx.shape_rectangle_filled_unbuffered_program
    geometry = ctx.shape_rectangle_filled_unbuffered_geometry
    buffer = ctx.shape_rectangle_filled_unbuffered_buffer
    # We need to normalize the color because we are setting it as a float uniform
    if len(color) == 3:
        color_normalized = (color[0] / 255, color[1] / 255, color[2] / 255, 1.0)
    elif len(color) == 4:
        color_normalized = (color[0] / 255, color[1] / 255, color[2] / 255, color[3] / 255)  # type: ignore
    else:
        raise ValueError("Invalid color format. Use a 3 or 4 component tuple")

    program['color'] = color_normalized
    program['shape'] = width, height, tilt_angle
    buffer.write(data=array.array('f', (center_x, center_y)).tobytes())
    geometry.render(program, mode=ctx.POINTS, vertices=1)
Exemple #9
0
def draw_line(start_x: float, start_y: float, end_x: float, end_y: float,
              color: Color, line_width: float = 1):
    """
    Draw a line.

    :param float start_x: x position of line starting point.
    :param float start_y: y position of line starting point.
    :param float end_x: x position of line ending point.
    :param float end_y: y position of line ending point.
    :param Color color: color, specified in a list of 3 or 4 bytes in RGB or
         RGBA format.
    :param float line_width: Width of the line in pixels.
    """
    window = get_window()
    if not window:
        raise RuntimeError("No window found")

    ctx = window.ctx
    program = ctx.shape_line_program
    geometry = ctx.shape_line_geometry
    # We need to normalize the color because we are setting it as a float uniform
    if len(color) == 3:
        color_normalized = (color[0] / 255, color[1] / 255, color[2] / 255, 1.0)
    elif len(color) == 4:
        color_normalized = (color[0] / 255, color[1] / 255, color[2] / 255, color[3] / 255)  # type: ignore
    else:
        raise ValueError("Invalid color format. Use a 3 or 4 component tuple")

    program['line_width'] = line_width
    program['color'] = color_normalized
    ctx.shape_line_buffer_pos.write(
        data=array.array('f', [start_x, start_y, end_x, end_y]).tobytes())
    geometry.render(program, mode=gl.GL_LINES, vertices=2)
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Escapade")
    arcade.set_background_color(arcade.color.GRAY)
    arcade.schedule(on_update, 1 / 60)

    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press

    # sets the 2D list to be used for the grid
    for row in range(9):
        grid.append([])
        for column in range(16):
            grid[row].append(0)

    for row in range(9):
        for column in range(16):
            if row == 0 or row == 8:
                grid[row][column] = 1
            elif column == 0 or column == 15:
                grid[row][column] = 1

    arcade.run()
Exemple #11
0
def setup():
    arcade.open_window(screen_width, screen_height, "My Arcade Game")
    arcade.set_background_color(arcade.color.BLACK)
    arcade.schedule(on_update, 1 / 60)

    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press

    # create a 10 x 10 2D list of numbers

    # --- Populate grid the grid
    # Loop for each row
    for row in range(row_count):
        # For each row, create a list that will
        # represent an entire row
        grid.append([])
        # Loop for each column
        for column in range(column_count):
            # Add a the number zero to the current row
            grid[row].append(0)

    arcade.run()
    def on_show(self):

        self.window = arcade.get_window()

        self.draw_play_button_hover = False

        self.hovering = False
        self.clicking = False

        self.old_screen_center_x = int(self.window.get_size()[0] / 2)
        self.old_screen_center_y = int(self.window.get_size()[1] / 2)
        self.screen_center_x = int(self.window.get_size()[0] / 2)
        self.screen_center_y = int(self.window.get_size()[1] / 2)

        game_title_text = 'Flimsy Billy\'s Coin Dash 3: Super Duper Tag 3 Electric Tree'
        self.title_text = arcade.draw_text(game_title_text,
                                           self.screen_center_x,
                                           self.screen_center_y + 150,
                                           anchor_x='center',
                                           anchor_y='center',
                                           color=arcade.csscolor.WHITE,
                                           font_size=32)
        play_text = 'Play'
        self.play_button = play_text_sprite = arcade.draw_text(
            play_text,
            self.screen_center_x,
            self.screen_center_y,
            anchor_x='center',
            anchor_y='center',
            color=arcade.csscolor.WHITE,
            font_size=64)

        arcade.set_background_color([66, 245, 212, 255])

        arcade.set_viewport(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT)
Exemple #13
0
def setup():
    """Loads sprites and sets up the window and creates user input
    """    
    global player_texture, player_bullet_texture, enemy_texture, enemy_bullet_texture, enemy_two_texture, enemy_laser_charging_texture, enemy_laser_firing_texture
    global boss_texture, health_texture, rocket_texture, shield_texture
    arcade.open_window(WIDTH, HEIGHT, "HYPERSPACE Python Arcade Edition")
    arcade.set_background_color(arcade.color.BLACK)
    arcade.schedule(on_update, 1/60)
 
    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press
    window.on_mouse_release = on_mouse_release
    window.on_mouse_motion = on_mouse_motion
 
    #Load sprites
    player_texture = arcade.load_texture("images/Player.png")
    player_bullet_texture = arcade.load_texture("images/Bullet.png")
    enemy_texture = arcade.load_texture("images/Enemy.png")
    enemy_bullet_texture = arcade.load_texture("images/Enemy Bullet.png")
    enemy_two_texture = arcade.load_texture("images/Laser.png")
    enemy_laser_charging_texture = arcade.load_texture("images/Laser Charging.png")
    enemy_laser_firing_texture = arcade.load_texture("images/Laser Firing.png")
    boss_texture = arcade.load_texture("images/boss.png")
    health_texture = arcade.load_texture("images/Health_Pack.png")
    rocket_texture = arcade.load_texture("images/Rocket.png")
    shield_texture = arcade.load_texture("images/Shielded.png")

    arcade.run()
Exemple #14
0
    def setup(self):
        arcade.schedule(self.update, 1 / 30)
        (_w, _h) = arcade.get_window().get_size()

        w = int(_w / Const.BODY_SIZE) * Const.BODY_SIZE
        h = int(_h / Const.BODY_SIZE) * Const.BODY_SIZE
        Const.RIGHT = _w
        Const.TOP = Const.GAME_HEIGHT = h
        Const.SIDE_BAR = _w - w + Const.SIDE_BAR
        Const.GAME_WIDTH = _w - Const.SIDE_BAR
        Const.GRID_NR_W = int(Const.GAME_WIDTH / Const.BODY_SIZE)
        Const.GRID_NR_H = int(h / Const.BODY_SIZE)
        play_button = SmallButton('Menu', Const.RIGHT - Const.SIDE_BAR / 2,
                                  200, 15, self.play_method)
        quit_button = SmallButton('Quit', Const.RIGHT - Const.SIDE_BAR / 2,
                                  165, 15, self.quit_method)

        self.side_bar = Rectangle(_w - Const.SIDE_BAR, 0, Const.SIDE_BAR,
                                  Const.TOP, arcade.color.DARK_GRAY)
        self.button_list.append(play_button)
        self.button_list.append(quit_button)

        self.spawn_food()
        self.menu.setup()
        self.ghost_walk_indicator = GhostWalk.GhostWalkIndicator()
Exemple #15
0
def setup():
    """
    Sets up the screen, the main grid for the first level
    and all functions that allow the game to run
    """
    # define global variables
    global GRID, row, column, key_sound, teleport_sound, complete, background
    # set up the screen width and length using the variables at the beginning alongside the background
    arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "No Turning Back (Final Project)")
    arcade.set_background_color(arcade.color.BLACK)
    # create a system that constantly updates the game
    arcade.schedule(on_update, 1 / 60)
    # render the first level and the player function
    arcade.start_render()
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_update = on_update
    # create the grid for the first level
    for row in range(ROW_COUNT):
        GRID.append([])
        for column in range(COLUMN_COUNT):
            GRID[row].append(0)
    #load in all necessary sound files that will be used
    background = arcade.load_sound("sounds/background.wav")
    key_sound = arcade.load_sound("sounds/keysound.wav")
    teleport_sound = arcade.load_sound("sounds/teleport.wav")
    complete = arcade.load_sound("sounds/complete.wav")
    # start playing the background music
    arcade.play_sound(background)
    # run the program
    arcade.run()
def setup():
    global player_texture, player_bullet_texture, enemy_texture, enemy_bullet_texture, enemy_two_texture, enemy_laser_charging_texture, enemy_laser_firing_texture
    arcade.open_window(WIDTH, HEIGHT, "HYPERSPACE Python Arcade Edition")
    arcade.set_background_color(arcade.color.BLACK)
    arcade.schedule(on_update, 1/60)
 
    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press
    window.on_mouse_release = on_mouse_release
    window.on_mouse_motion = on_mouse_motion
 
    #Load sprites
    player_texture = arcade.load_texture("images/Player.png")
    player_bullet_texture = arcade.load_texture("images/Bullet.png")
    enemy_texture = arcade.load_texture("images/Enemy.png")
    enemy_bullet_texture = arcade.load_texture("images/Enemy Bullet.png")
    enemy_two_texture = arcade.load_texture("images/Beamer.png")
    enemy_laser_charging_texture = arcade.load_texture("images/Laser Charging.png")
    enemy_laser_firing_texture = arcade.load_texture("images/Laser Firing.png")
 
    arcade.run()
Exemple #17
0
def setup():
    """ Runs once once the program is starting up to load inital values for the program

    :return: none
    """
    global pac_grid, row_count, column_count, texture_tile, texture_pellet, texture_ghost, texture_ghost_change
    global pac_grid, row_count, column_count, tile_width, tile_height, pac_x, pac_y, score, texture_menu
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Game")
    arcade.set_background_color(arcade.color.BLACK)
    arcade.schedule(on_update, 1 / 60)

    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    # window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press

    # load images in setup
    texture_tile = arcade.load_texture(
        "pacific-blue-high-sheen-merola-tile-mosaic-tile-fyfl1spa-64_1000.jpg")
    texture_pellet = arcade.load_texture("Gold_Coin_PNG_Clipart-663.png")
    texture_ghost_change = arcade.load_texture("Pac-Man-Ghost-PNG-Image.png")
    texture_ghost = arcade.load_texture(
        "Download-Pac-Man-Ghost-PNG-Transparent-Image.png")
    texture_menu = arcade.load_texture("menu.jpeg")

    # # create the pacman grid
    set_up_maze()

    arcade.run()
def get_pixel(x: int, y: int) -> Tuple[int, int, int]:
    """
    Given an x, y, will return RGB color value of that point.

    :param int x: x location
    :param int y: y location
    :returns: Color
    """
    # noinspection PyCallingNonCallable,PyTypeChecker

    # The window may be 'scaled' on hi-res displays. Particularly Macs. OpenGL
    # won't account for this, so we need to.
    window = get_window()
    if not window:
        raise ValueError("No window is available to get pixel data from.")

    pixel_ratio = window.get_pixel_ratio()
    x = int(pixel_ratio * x)
    y = int(pixel_ratio * y)

    a = (gl.GLubyte * 3)(0)
    gl.glReadPixels(x, y, 1, 1, gl.GL_RGB, gl.GL_UNSIGNED_BYTE, a)
    red = a[0]
    green = a[1]
    blue = a[2]
    return red, green, blue
    def __init__(self, window=None, attach_callbacks=True, **kwargs):
        """
        Creates a new :py:class:`arcade.gui.UIManager` and
        registers the corresponding handlers to the current window.

        The UIManager has to be created, before
        :py:meth:`arcade.Window.show_view()`
        has been called.

        To support multiple views a singleton UIManager should be passed to all views.
        As an alternative you can remove all registered handlers of a UIManager by calling
        :py:meth:`arcade.gui.UIManager.unregister_handlers()` within :py:meth:`arcade.View.on_hide_view()`.

        :param arcade.Window window: Window to register handlers to, defaults to :py:meth:`arcade.get_window()`
        :param kwargs: catches unsupported named parameters
        """
        super().__init__()
        # TODO really needed?
        self.window: Window = window if window else arcade.get_window()

        self._focused_element: Optional[UIElement] = None
        self._hovered_element: Optional[UIElement] = None

        self._ui_elements: SpriteList = SpriteList(use_spatial_hash=True)
        self._id_cache: Dict[str, UIElement] = {}

        self.register_event_type('on_ui_event')

        if attach_callbacks:
            self.register_handlers()
def setup():
    global grid, fps
    arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Snake Game")
    schedule(fps)
    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press

    # create body for snake
    rsnake.append(4)
    rsnake.append(4)
    rsnake.append(4)
    csnake.append(6)
    csnake.append(6)
    csnake.append(6)

    # array is simply a list of lists.
    for row in range(ROW_COUNT + 1):
        # Add an empty array that will hold each cell
        # in this row
        grid.append([])
        for column in range(COLUMN_COUNT + 1):
            grid[row].append(0)  # Append a cell

    arcade.run()
Exemple #21
0
def setup():
    global background_img, player

    player = Ship(filename="../assets/space_shooter/PNG/playerShip1_red.png",
                  center_x=WIDTH / 2,
                  center_y=HEIGHT / 2,
                  scale=0.5)

    # create powerups
    # for _ in range(10):
    #     powerup = PowerUp("../assets/space_shooter/PNG/Power-ups/powerupGreen_star.png", 0.5)
    #     powerup.position = Vec2d(random.randrange(WIDTH), random.randrange(HEIGHT))
    #     powerup.velocity = Vec2d(random.randrange(-2, 2), random.randrange(-2, 2))
    #     powerups.append(powerup)

    # for meteor in asdict(levels[0]).get("meteors"):
    #     meteors.append(meteor)

    arcade.open_window(WIDTH, HEIGHT, "Spacer")
    arcade.set_background_color(arcade.color.BLACK)
    arcade.schedule(on_update, 1 / 80)

    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press

    arcade.run()
Exemple #22
0
    def __init__(self, window: Window = None):
        if window is None:
            window = arcade.get_window()

        self._window = window
        self._zoom = 1

        self.center = window.width // 2, window.height // 2
Exemple #23
0
def main():
    acd.open_window(WIN_WT, WIN_HT, WIN_TT, True)
    acd.schedule(update, UPDATE_RATE)

    window = acd.get_window()
    window.on_mouse_press = mouse_click

    acd.run()
    def __init__(self, window: Window = None):

        if window is None:
            self.window = arcade.get_window()
        else:
            self.window = window

        self.key: Optional[int] = None
 def _get_manager(self, manager=None):
     if manager is None:
         curtains = arcade.get_window().curtains
         if not curtains.current_scene:
             msg = 'use curtains.set_scene before animating a sprite'
             raise NoActiveSceneException(msg)
         manager = curtains.current_scene.animations
     return manager
Exemple #26
0
def draw_lines():
    arcade.open_window(800, 800, "lines Demo")
    arcade.set_background_color(arcade.color.FAWN)
    width = arcade.get_window().width
    height = arcade.get_window().height

    arcade.start_render()
    #drawings here
    for location in range(80, width, 80):
        arcade.draw_line(location, 0, location, height, arcade.color.BLACK, 2)
    for horizontal_location in range(80, height, 80):
        arcade.draw_line(0, horizontal_location, width, horizontal_location,
                         arcade.color.BLACK, 2)

    arcade.finish_render()

    arcade.run()
Exemple #27
0
    def update(self, delta_time, mouse_x, mouse_y):


        if self.oxygen >= self.max_oxygen:
            self.oxygen = self.max_oxygen
        
        self.oxygen -= delta_time


        current_screen_width = arcade.get_window().width
        current_screen_height = arcade.get_window().height



        if self.last_shot >= self.shoot_speed:
            self.last_shot = self.shoot_speed
        else:
            self.last_shot += 1 * delta_time


        if self.at_base:
            self.fuel = self.max_fuel
            self.oxygen = self.max_oxygen

        mouse_x_relative = mouse_x - current_screen_width/2
        mouse_y_relative = mouse_y - current_screen_height/2
        self.radians = math.atan2(mouse_y_relative, mouse_x_relative) - 1.5708

        self.velocity_radians = math.atan2(self.delta_y, self.delta_x) - 1.5708
        if self.damping:
            if self.delta_x > 0:
                self.delta_x += (self.delta_x * math.sin(self.velocity_radians)*delta_time) * self.dampers
            else:
                self.delta_x -= (self.delta_x * math.sin(self.velocity_radians)*delta_time) *self.dampers
            if self.delta_y > 0:
                self.delta_y -= (self.delta_y * math.cos(self.velocity_radians)*delta_time) * self.dampers
            else:
                self.delta_y += (self.delta_y * math.cos(self.velocity_radians)*delta_time) *self.dampers
        elif self.thrusting and self.fuel > 0:
            self.fuel -= 1 * delta_time
            self.delta_x += -self.thrusters * math.sin(self.radians)*delta_time
            self.delta_y += self.thrusters * math.cos(self.radians)*delta_time

        self.center_x += self.delta_x*delta_time
        self.center_y += self.delta_y*delta_time
Exemple #28
0
 def on_mouse_press(self, x, y, button, modifiers):
     """
     Called whenever mouse is pressed.
     :param: key (key) - key pressed
     :param: modifiers - life cycle method
     :post: Checks to see if the mouse was pressed and advances the game state if it was
     """
     player2 = Player(DummyView.players[0].num_of_ships)
     next_player_ships_placement = AI_place(player2)
     self.window.show_view(next_player_ships_placement)
     if DummyView.iterations == 2 and not DummyView.has_ran:
         arcade.get_window().set_visible(False)
         player1 = DummyView.players[0]
         player2 = DummyView.players[1]
         GAME = aiGame(player1, player2)
         arcade.set_window(GAME.player1_other_board)
         arcade.schedule(GAME.run, 0.25)
         DummyView.has_ran = True
Exemple #29
0
 def __init__(self, *, viewport: Tuple[int, int, int, int], projection: Tuple[float, float, float, float],
              ):
     """Test"""
     self._window = arcade.get_window()
     self._viewport = viewport
     self._projection = projection
     self._scroll_x: float = 0
     self._scroll_y: float = 0
     self._zoom: float = 0
Exemple #30
0
 def __init__(self,
              title: str,
              show_message: str,
              icon: str = "error",
              *args: object):
     self.title = title
     self.show_message = show_message
     self._icon = icon
     super().__init__(show_message, *args)
     try:
         arcade.get_window()
     except RuntimeError:
         # If we aren't in an arcade Window (e.g., unit esting) we don't need the sprite stuff.
         return
     self.icon = img_from_resource(charm.data.images.errors, f"{icon}.png")
     self.icon.resize((32, 32), PIL.Image.LANCZOS)
     self.sprite = self.get_sprite()
     self.sprite.set_position(Settings.width / 2, Settings.height / 2)