Example #1
0
def setup():
    global toolbar, frames

    arcadeplus.open_window(WIDTH, HEIGHT, "AnimationCreator")
    arcadeplus.set_background_color(arcadeplus.color.WHITE)
    scheduling_update_time = 0.01666666666  # float value is same as 1/60
    arcadeplus.schedule(on_update, scheduling_update_time)

    # Create Vertex Buffer Object (VBO) shape lists
    frames.append(arcadeplus.ShapeElementList())
    toolbar = arcadeplus.ShapeElementList()

    # Override arcade window methods
    window = arcadeplus.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_drag = on_mouse_drag

    # Render toolbar
    render_toolbar_dividers()
    render_toolbar_shapes()
    render_toolbar_colors()
    render_toolbar_icons()
    render_toolbar_text()

    arcadeplus.run()
Example #2
0
def main():
    """
    This is the main program.
    """

    # Open the window
    arcadeplus.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)

    # Start the render process. This must be done before any drawing commands.
    arcadeplus.start_render()

    # Call our drawing functions.
    draw_background()
    draw_pine_tree(50, 250)
    draw_pine_tree(350, 320)
    draw_bird(70, 500)
    draw_bird(470, 550)

    # Finish the render.
    # Nothing will be drawn without this.
    # Must happen after all draw commands
    arcadeplus.finish_render()

    # Keep the window up until someone closes it.
    arcadeplus.run()
Example #3
0
def main():
    # Open up our window
    arcadeplus.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    arcadeplus.set_background_color(arcadeplus.color.WHITE)

    # Tell the computer to call the draw command at the specified interval.
    arcadeplus.schedule(on_draw, 1 / 80)

    # Run the program
    arcadeplus.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "TOHACKS SARS COV-2 Model")
    arcade.set_background_color(arcade.color.LIGHT_STEEL_BLUE)
    arcade.schedule(update, 1 / 60)

    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_mouse_press = on_mouse_press
    window.on_mouse_release = on_mouse_release
    window.on_mouse_motion = on_mouse_motion

    arcade.run()
Example #5
0
def main():
    arcadeplus.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, TITLE)
    arcadeplus.set_background_color(BACKGROUND_COLOR)
    arcadeplus.start_render()
    arcadeplus.draw_circle_filled(400, 250, 100, arcadeplus.color.BLACK)
    # load image
    image = arcadeplus.load_texture(resource_path('character.png'))
    arcadeplus.draw_texture_rectangle(200, 250, image.width, image.height,
                                      image)
    # load sound
    sound = arcadeplus.sound.load_sound(resource_path('cat-meow.wav'))
    arcadeplus.sound.play_sound(sound)
    arcadeplus.finish_render()
    arcadeplus.run()
    return
def setup():
    arcade.open_window(WIDTH, HEIGHT, "TOHACKS SARS COV-2 Model")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(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

    arcade.run()
Example #7
0
def main():
    """
    This is the main program.
    """

    # Open the window
    arcadeplus.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)

    # Start the render process. This must be done before any drawing commands.
    arcadeplus.start_render()

    # Call our drawing functions.
    draw_background()

    # Loop to draw ten birds in random locations.
    for bird_count in range(10):
        # Any random x from 0 to the width of the screen
        x = random.randrange(0, SCREEN_WIDTH)

        # Any random y from in the top 2/3 of the screen.
        # No birds on the ground.
        y = random.randrange(SCREEN_HEIGHT / 3, SCREEN_HEIGHT - 20)

        # Draw the bird.
        draw_bird(x, y)

    # Draw the top row of trees
    for x in range(45, SCREEN_WIDTH, 90):
        draw_pine_tree(x, SCREEN_HEIGHT / 3)

    # Draw the bottom row of trees
    for x in range(65, SCREEN_WIDTH, 90):
        draw_pine_tree(x, (SCREEN_HEIGHT / 3) - 120)

    # Finish the render.
    # Nothing will be drawn without this.
    # Must happen after all draw commands
    arcadeplus.finish_render()

    # Keep the window up until someone closes it.
    arcadeplus.run()
Example #8
0
def main():
    window = arcadeplus.Window(WIDTH, HEIGHT,
                               "Instruction and Game Over Views Example")
    menu = MenuView()
    window.show_view(menu)
    arcadeplus.run()
Example #9
0
def main():
    MyGame()
    arcadeplus.run()
Example #10
0
def main():
    window = arcadeplus.Window(WIDTH, HEIGHT, "Different Views Minimal Example")
    menu_view = MenuView()
    window.show_view(menu_view)
    arcadeplus.run()
Example #11
0
def setup():
    create_birds()
    arcadeplus.schedule(update, 1 / 60)
    arcadeplus.run()
Example #12
0
def main():
    """ Main method """
    MyGame()
    arcadeplus.run()
Example #13
0
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.start_new_game()
    arcadeplus.run()
Example #14
0
def main():
    """ Main method """
    window = MyGame()
    window.setup()
    arcadeplus.run()
Example #15
0
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.setup()
    arcadeplus.run()
Example #16
0
def main():
    window = MyGame()
    window.setup()
    arcadeplus.run()
Example #17
0
def main():
    """ Main method """
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    game.setup()
    arcadeplus.run()
Example #18
0
def main():
    window = arcadeplus.Window(WIDTH, HEIGHT, "Different Views Example")
    window.total_score = 0
    menu_view = MenuView()
    window.show_view(menu_view)
    arcadeplus.run()
Example #19
0
def main():
    MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    arcadeplus.run()
def setup():
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(update, 1 / 60)
    arcade.run()
Example #21
0
def main():
    game = MyGame()
    game.setup()
    arcadeplus.run()
Example #22
0
def main():
    window = Window()
    window.setup()
    arcadeplus.run()
Example #23
0
                           360, 45)

# Draw an rectangle outline
arcadeplus.draw_text("draw_rect", 243, 3, arcadeplus.color.BLACK, 10)
arcadeplus.draw_rectangle_outline(295, 100, 45, 65,
                                  arcadeplus.color.BRITISH_RACING_GREEN)
arcadeplus.draw_rectangle_outline(295, 160, 20, 45,
                                  arcadeplus.color.BRITISH_RACING_GREEN, 3, 45)

# Draw a filled in rectangle
arcadeplus.draw_text("draw_filled_rect", 363, 3, arcadeplus.color.BLACK, 10)
arcadeplus.draw_rectangle_filled(420, 100, 45, 65, arcadeplus.color.BLUSH)
arcadeplus.draw_rectangle_filled(420, 160, 20, 40, arcadeplus.color.BLUSH, 45)

# Load and draw an image to the screen
# Image from kenney.nl asset pack #1
arcadeplus.draw_text("draw_bitmap", 483, 3, arcadeplus.color.BLACK, 12)
texture = arcadeplus.load_texture(
    ":resources:images/space_shooter/playerShip1_orange.png")
scale = .6
arcadeplus.draw_scaled_texture_rectangle(540, 120, texture, scale, 0)
arcadeplus.draw_scaled_texture_rectangle(540, 60, texture, scale, 45)

# Finish the render.
# Nothing will be drawn without this.
# Must happen after all draw commands
arcadeplus.finish_render()

# Keep the window up until someone closes it.
arcadeplus.run()
Example #24
0
def main():
    window = MyGame()
    window.start_new_game()
    arcadeplus.run()