def main():
    # Open up our window
    arcade.open_window("Bouncing Rectangle Example", SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.set_background_color(arcade.color.WHITE)

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

    # Run the program
    arcade.run()
Exemple #2
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Bouncing Ball Game")
    arcade.set_background_color(arcade.color.BLUEBONNET)
    arcade.schedule(on_update, 1 / 100)

    # 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

    arcade.run()
Exemple #3
0
    def unshrink(self):
        # Handles unshrinking.
        self.shrunk = False
        self.player_sprite.scale = sprite_scaling_player
        arcade.unschedule(self.shrink_charge_down)

        # If firing, switch to big bullets.
        if self.firing_small and self.lmb_down:
            arcade.unschedule(self.fire_small)
            arcade.schedule(self.fire_big, COOLDOWN_BIG)
            self.firing_big = True
            self.firing_small = False
Exemple #4
0
def main():
    # Create the display instance
    display = Display("Example 01")

    # Append the rectangles to the display rectangles list
    display.append(Rectangle(20, 20, 100, 200))

    # Change the rectangle colors on a schedule
    arcade.schedule(display.change_colors, 1)

    # Run the application
    arcade.run()
Exemple #5
0
def setup():
    arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    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_mouse_press = on_mouse_press
    window.on_update = on_update

    arcade.run()
Exemple #6
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Platformer")
    arcade.set_background_color(arcade.color.SKY_BLUE)
    arcade.schedule(update, 1/80)

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

    arcade.run()
Exemple #7
0
def main():
    arcade.open_window(600, 600, "BB8")
    arcade.set_background_color(arcade.color.WHEAT)
    arcade.start_render()
    draw_BB8(100, 50, 50, True)
    draw_BB8(300, 300, 30, True)
    draw_BB8(500, 100, 20, True)
    draw_BB8(500, 400, 60, True)
    draw_BB8(120, 500, 15, True)
    if movers:
        arcade.schedule(move, 1/20)
    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Pong")
    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

    arcade.run()
Exemple #9
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Pine trees")
    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

    arcade.run()
Exemple #10
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Final Project")
    arcade.set_background_color(arcade.color.BLUE_GRAY)
    arcade.schedule(on_update, 1 / 60)

    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 #11
0
def main():
    # Open up our window
    arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT,
                       "Bouncing Rectangle Example")
    arcade.set_background_color(arcade.color.WHITE)

    # The "schedule" command
    # Tell the computer to call the draw command 80 times per second
    arcade.schedule(on_draw, 1 / 80)

    # Run the program
    arcade.run()
Exemple #12
0
def main():

    arcade.open_window("WHALE", 800, 600)

    arcade.set_background_color(arcade.color.PLUM)
    draw_sunset(800, 500)
    draw_ocean(50, 50)
    draw_whale(500, 200)
    arcade.schedule(on_draw, 1 / 80)

    arcade.finish_render()
    arcade.run()
Exemple #13
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Game")
    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

    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Game")
    arcade.set_background_color(arcade.color.DARK_BLUE)
    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

    arcade.run()
Exemple #15
0
def setup():
    arcade.open_window(1000, 600, "My Arcade Game")
    arcade.set_background_color(arcade.color.WHITE_SMOKE)
    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

    arcade.run()
Exemple #16
0
def setup():
    global current_screen
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Game")
    arcade.set_background_color(arcade.color.LIGHT_BLUE)
    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

    arcade.run()
Exemple #17
0
def setup():
    arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, "Python Arcade Game: StormPlane")
    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

    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Computers & Society Poster")
    arcade.set_background_color(arcade.color.COCONUT)
    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

    arcade.run()
Exemple #19
0
def main():
    arcade.open_window(screen_width, screen_height,
                       "Amazon Fulfillment Centre")
    arcade.set_background_color(arcade.color.BLACK)

    arcade.schedule(on_update, 1 / 60)
    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 #20
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, 'Power recycling demo')
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(update, 1 / 180)

    # 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

    arcade.run()
Exemple #21
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Rock, scissors, paper")
    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

    arcade.run()
Exemple #22
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Poster - Malware Prevention")
    arcade.set_background_color(arcade.color.LIGHT_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

    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Game")
    arcade.set_background_color(arcade.color.DARK_MOSS_GREEN)
    arcade.schedule(update, 1 / 60)

    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

    arcade.run()
Exemple #24
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Game")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(update, 1/60)
    arcade.set_viewport(-WIDTH/2, WIDTH/2, -HEIGHT/2, HEIGHT/2)

    # 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

    arcade.run()
Exemple #25
0
def main():
    # Open up our window
    arcade.open_window("Bouncing Ball", SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.set_background_color(arcade.color.WHITE)

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

    # Run the program
    arcade.run()

    # When done running the program, close the window.
    arcade.close_window()
Exemple #26
0
def main():
    # Open up our window
    arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    arcade.set_background_color(arcade.color.WHITE)

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

    # Run the program
    arcade.run()

    # When done running the program, close the window.
    arcade.close_window()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Poster")
    arcade.schedule(on_update, 1/60)
    arcade.set_background_color(arcade.color.INDIAN_YELLOW)
    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_update = on_update
    window.on_key_press = on_key_press
    window.on_key_release = on_key_release
    window.on_mouse_press = on_mouse_press

    arcade.run()
Exemple #28
0
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Pants Vs. Zombies")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(update, 1 / 60)
    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 = mouse_motion

    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "My Arcade Game")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(on_update, 1 / 60)

    # Override arcade window methods
    window = arcade.get_window()
    window.on_draw = on_draw
    window.on_update = on_update
    window.on_mouse_press = on_mouse_press
    window.start_screen = start_screen

    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT, "Anti-cyberbully Poster")
    arcade.set_background_color(arcade.color.WHITE)
    arcade.schedule(on_update, 1 / 60)

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

    arcade.run()
def setup():
    arcade.open_window(WIDTH, HEIGHT,
                       "Contemporary art: Diminished life in bar.")
    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

    arcade.run()
Exemple #32
0
    def setup(self):

        self.paused = False

        arcade.set_background_color(arcade.color.RICH_ELECTRIC_BLUE)

        self.player = arcade.Sprite("sprites/duck_small.png", 0.5)
        self.player.center_y = self.height / 2
        self.player.left = 10
        self.all_sprites.append(self.player)

        arcade.schedule(self.add_enemy, 0.5)
        arcade.schedule(self.add_lotus, 2.0)
Exemple #33
0
    if draw.y < CIRCLE_RADIUS and draw.delta_y < 0:
        # If we bounce with a decent velocity, do a normal bounce.
        # Otherwise we won't have enough time resolution to accurate represent
        # the bounce and it will bounce forever. So we'll divide the bounciness
        # by half to let it settle out.
        if draw.delta_y * -1 > GRAVITY_CONSTANT * 15:
            draw.delta_y *= -BOUNCINESS
        else:
            draw.delta_y *= -BOUNCINESS / 2

# These are function-specific variables. Before we
# use them in our function, we need to give them initial
# values.
draw.x = CIRCLE_RADIUS
draw.y = SCREEN_HEIGHT - CIRCLE_RADIUS
draw.delta_x = 2
draw.delta_y = 0

# Open up our window
arcade.open_window("Bouncing Ball", SCREEN_WIDTH, SCREEN_HEIGHT)
arcade.set_background_color(arcade.color.WHITE)

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

# Run the program
arcade.run()

# When done running the program, close the window.
arcade.close_window()
Exemple #34
0
on_draw.tires = arcade.Circle(595,30,20,arcade.color.BLACK)
shapes.append(on_draw.tires)

####END OF SEMI

####START OF ORANGE CAR

#body of the car
on_draw.car = arcade.Rectangle(30,28,60,60,arcade.color.ORANGE)
shapes.append(on_draw.car)
on_draw.car = arcade.Rectangle(10,21.5,35,35,arcade.color.ORANGE)
shapes.append(on_draw.car)
on_draw.car = arcade.Rectangle(50,21.5,35,35,arcade.color.ORANGE)
shapes.append(on_draw.car)

#tires of car
on_draw.tires = arcade.Circle(18,20,11,arcade.color.BLACK)
shapes.append(on_draw.tires)
on_draw.tires = arcade.Circle(100,20,11,arcade.color.BLACK)
shapes.append(on_draw.tires)

####END OF CAR


arcade.schedule(on_draw, 1 / 80)

arcade.run()

#unnecssary if drawing with on_draw
#arcade.finish_render()