How to use the arcade.color.WHITE function in arcade

To help you get started, we’ve selected a few arcade examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pvcraven / arcade / tests / unit2 / test_sound.py View on Github external
def __init__(self, width, height):
        """
        Initializer
        """
        super().__init__(width, height)

        arcade.set_background_color(arcade.color.WHITE)
        self.laser_wav = arcade.load_sound(":resources:sounds/laser1.wav")
        self.laser_mp3 = arcade.load_sound(":resources:laser1.mp3")
        self.laser_ogg = arcade.load_sound(":resources:laser1.ogg")
        self.frame_count = 0
github pvcraven / arcade_book / source / chapters / 19_moving_sprites / sprites_circle.py View on Github external
def on_draw(self):

        # This command has to happen before we start drawing
        arcade.start_render()

        # Draw all the sprites.
        self.coin_list.draw()
        self.player_list.draw()

        # Put the text on the screen.
        output = "Score: " + str(self.score)
        arcade.draw_text(output, 10, 20, arcade.color.WHITE, 14)
github pvcraven / arcade / Testing shape objects.py View on Github external
on_draw.oval.draw()
    on_draw.ellipse.draw()
    on_draw.circle.draw()
    on_draw.square.draw()
    arcade.draw_all(shapes)

    #update shape positions
    on_draw.rectangle.update()
    on_draw.oval.update()
    on_draw.ellipse.update()
    on_draw.circle.update()
    on_draw.square.update()
    arcade.update_all(shapes)

arcade.open_window("Drawing Example", 800, 600)
arcade.set_background_color(arcade.color.WHITE)

on_draw.rectangle = arcade.Rectangle(400 , 100, 35, 50, arcade.color.PURPLE)
on_draw.rectangle.change_x = 3
on_draw.rectangle.change_y = 2

on_draw.oval = arcade.Oval(250, 250, 50, 25, arcade.color.ORANGE)
on_draw.oval.change_x = 1
on_draw.oval.change_y = -1

on_draw.ellipse = arcade.Ellipse(500, 0, 25, 50, arcade.color.COCONUT)
on_draw.ellipse.change_y = 2
on_draw.ellipse.change_angle = 15

on_draw.circle = arcade.Circle(350, 250, 15, arcade.color.BLUE)
on_draw.circle.change_x = 1
github pvcraven / arcade / examples / starting_template.py View on Github external
def __init__(self, width, height):
        super().__init__(width, height)

        self.ball_x_position = BALL_RADIUS
        self.ball_x_pixels_per_second = 70

        arcade.set_background_color(arcade.color.WHITE)
github pvcraven / arcade_book / source / chapters / 20_platformers / sprite_tiled_map.py View on Github external
# Draw all the sprites.
        self.all_sprites_list.draw()

        # Put the text on the screen.
        # Adjust the text position based on the view port so that we don't
        # scroll the text too.
        distance = self.view_left + self.player_sprite.right
        output = f"Distance: {distance}"
        arcade.draw_text(output, self.view_left + 10, self.view_bottom + 20, arcade.color.WHITE, 14)

        if self.game_over:
            output = "Game Over"
            arcade.draw_text(output, self.view_left + 200,
                             self.view_bottom + 200,
                             arcade.color.WHITE, 30)
github pvcraven / arcade / arcade / examples / sprite_moving_platforms.py View on Github external
# This command has to happen before we start drawing
        arcade.start_render()

        # Draw the sprites.
        self.static_wall_list.draw()
        self.moving_wall_list.draw()
        self.player_list.draw()

        # Put the text on the screen.
        # Adjust the text position based on the viewport so that we don't
        # scroll the text too.
        distance = self.player_sprite.right
        output = f"Distance: {distance}"
        arcade.draw_text(output, self.view_left + 10, self.view_bottom + 20,
                         arcade.color.WHITE, 14)
github pvcraven / arcade / arcade / examples / maze_recursive.py View on Github external
# Start timing how long this takes
        draw_start_time = timeit.default_timer()

        # Draw all the sprites.
        self.wall_list.draw()
        self.player_list.draw()

        # Draw info on the screen
        sprite_count = len(self.wall_list)

        output = f"Sprite Count: {sprite_count}"
        arcade.draw_text(output,
                         self.view_left + 20,
                         SCREEN_HEIGHT - 20 + self.view_bottom,
                         arcade.color.WHITE, 16)

        output = f"Drawing time: {self.draw_time:.3f}"
        arcade.draw_text(output,
                         self.view_left + 20,
                         SCREEN_HEIGHT - 40 + self.view_bottom,
                         arcade.color.WHITE, 16)

        output = f"Processing time: {self.processing_time:.3f}"
        arcade.draw_text(output,
                         self.view_left + 20,
                         SCREEN_HEIGHT - 60 + self.view_bottom,
                         arcade.color.WHITE, 16)

        self.draw_time = timeit.default_timer() - draw_start_time
github pvcraven / arcade / arcade / examples / view_instructions_and_game_over.py View on Github external
def on_show(self):
        arcade.set_background_color(arcade.color.WHITE)
github pvcraven / arcade / examples / shape_list_demo_person.py View on Github external
def make_person(head_radius,
                chest_height,
                chest_width,
                leg_width,
                leg_height,
                arm_width,
                arm_length,
                arm_gap,
                shoulder_height):

    shape_list = arcade.ShapeElementList()

    # Head
    shape = arcade.create_ellipse_filled(0, chest_height / 2 + head_radius, head_radius, head_radius,
                                         arcade.color.WHITE)
    shape_list.append(shape)

    # Chest
    shape = arcade.create_rectangle_filled(0, 0, chest_width, chest_height, arcade.color.BLACK)
    shape_list.append(shape)

    # Left leg
    shape = arcade.create_rectangle_filled(-(chest_width / 2) + leg_width / 2, -(chest_height / 2) - leg_height / 2,
                                           leg_width, leg_height, arcade.color.RED)
    shape_list.append(shape)

    # Right leg
    shape = arcade.create_rectangle_filled((chest_width / 2) - leg_width / 2, -(chest_height / 2) - leg_height / 2,
                                           leg_width, leg_height, arcade.color.RED)
    shape_list.append(shape)
github pvcraven / arcade / arcade / examples / sprite_follow_simple_2.py View on Github external
def on_draw(self):
        """ Draw everything """
        arcade.start_render()
        self.coin_list.draw()
        self.player_list.draw()

        # Put the text on the screen.
        output = f"Score: {self.score}"
        arcade.draw_text(output, 10, 20, arcade.color.WHITE, 14)