Esempio n. 1
0
def main():
    """
    This is the main program.
    """

    # Open the window
    arcade.open_window("Drawing With Functions", 600, 600)

    # Start the render process. This must be done before any drawing commands.
    arcade.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
    arcade.finish_render()

    # Keep the window up until someone closes it.
    arcade.run()
Esempio n. 2
0
def main():
    """
    This is the main program.
    """

    # Open the window
    arcade.open_window("Drawing With Functions", SCREEN_WIDTH, SCREEN_HEIGHT)

    # Start the render process. This must be done before any drawing commands.
    arcade.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)
    draw_bird(175, 450)
    draw_bird(525, 475)
    draw_bird(415, 475)

    # My drawing of PACMAN
    arcade.draw_arc_filled(225, 230, 36, 36,
                       arcade.color.YELLOW, 90, 360, -45)


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

    # Keep the window up until someone closes it.
    arcade.run()
Esempio n. 3
0
    def run(self):

        arcade.set_background_color((127, 127, 255))
        arcade.set_viewport(self.ortho_left, WINDOW_WIDTH + self.ortho_left,
                            0, WINDOW_HEIGHT)
        self.setup_game()

        arcade.run()
Esempio n. 4
0
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()
Esempio n. 5
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()
Esempio n. 6
0
def main():
    """
    This is the main program.
    """

    # Open the window
    arcade.open_window("Drawing With Loops", SCREEN_WIDTH, SCREEN_HEIGHT)

    # Start the render process. This must be done before any drawing commands.
    arcade.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
    arcade.finish_render()

    # Keep the window up until someone closes it.
    arcade.run()
Esempio n. 7
0
def main():
    """ Main method """
    window = GameWindow(1280, 1024, SCREEN_TITLE)
    window.setup()
    arcade.run()
Esempio n. 8
0
def main():
    window = MyGame()
    window.setup()
    arcade.run()
Esempio n. 9
0
COLUMN_SPACING = 60
ROW_SPACING = 40

TEXT_SIZE = 12

# Open the window and set the background
arcade.open_window("Complex Loops - Box", 600, 400)

arcade.set_background_color(arcade.color.WHITE)

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

# Loop for each row
for row in range(10):
    # Loop for each column
    for column in range(10):
        # Calculate our location
        x = column * COLUMN_SPACING
        y = row * ROW_SPACING

        # Draw the item
        arcade.draw_text("({}, {})".format(column, row), x, y,
                         arcade.color.BLACK, TEXT_SIZE)

# Finish the render.
arcade.finish_render()

# Keep the window up until someone closes it.
arcade.run()
Esempio n. 10
0
def main():
    game = MyGame(600, 600, 'Drawing Example', arcade.color.WHEAT)
    game.position = 100
    game.velocity = 700
    arcade.run()
Esempio n. 11
0
def main():
    MyGame(SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.run()
Esempio n. 12
0
def main():
    window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.setup()
    arcade.run()
def main():
    arcade.run()
Esempio n. 14
0
def main():
    Render(SW, SH, "Snow")
    arcade.run()
Esempio n. 15
0
def main():
    """ Main method """
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    game.setup()
    arcade.run()
Esempio n. 16
0
def main():
    # Main Event
    window = View()
    window.setup()
    arcade.run()
Esempio n. 17
0
def main():
	window = Game()
	# Runs the setup method before anything else
	window.setup()
	arcade.run()
Esempio n. 18
0
def main():
    """ Main method """

    window = Leikur()
    window.setup()
    arcade.run()
Esempio n. 19
0
def main():
    window = MyGame()
    window.start_new_game()
    arcade.run()
Esempio n. 20
0
def draw(information):
    """ Main method. Denna funktion anropar hela denna fil """
    game = PlacementDraw(SCREEN_WIDTH, SCREEN_HEIGHT, information)
    game.setup()
    arcade.run()
Esempio n. 21
0
def main():
    """ Main method """
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT)
    game.setup()
    arcade.run()
Esempio n. 22
0
def main():
    MyGame(600, 600, 'My Game')
    arcade.run()
Esempio n. 23
0
def main():
    Main_Window().start_new_game()
    run()
Esempio n. 24
0
def main():
    window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    start_view = InstructionView()
    window.show_view(start_view)
    arcade.run()
Esempio n. 25
0
def main():
    window = MyApp(600, 600)
    window.setup()
    arcade.run()
Esempio n. 26
0
 def start():
     arcade.run()
Esempio n. 27
0
def main():
    window = MyGame(640, 480, "Drawing Example")

    arcade.run()
def main():
    window = Render(screen_width, screen_height, 'Boxes')
    arcade.run()
Esempio n. 29
0
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.setup()
    arcade.run()
Esempio n. 30
0
import Menu

BASE_WINDOW_WIDTH = 1000
BASE_WINDOW_HEIGHT = 600
WINDOW_TITLE = "Pong by Loupio"


class Pong(ac.Window):
    musics = {
        "select": ac.load_sound("assets/menu/button_select.mp3"),
        "music": ac.load_sound("assets/game/thefatrat-windfall.mp3"),
        "ping_pong": ac.load_sound("assets/game/ping_pong.mp3")
    }

    def __init__(self):
        super(Pong, self).__init__(BASE_WINDOW_WIDTH, BASE_WINDOW_HEIGHT, WINDOW_TITLE)
        self.set_fullscreen()

        self.show_menu()

    def start_game(self):
        self.show_view(Game.Game(self))

    def show_menu(self):
        self.show_view(Menu.Menu(self))


if __name__ == '__main__':
    app = Pong()
    ac.run()
Esempio n. 31
0
def main():
    """ Main method """
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.setup()
    arcade.run()
Esempio n. 32
0
def main():
    MyAppWindow()
    arcade.run()
Esempio n. 33
0
def main():
    """ Main method """
    window = MyGame()
    window.setup()
    arcade.run()
Esempio n. 34
0
def main():
    MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.run()
Esempio n. 35
0
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.setup()
    arcade.run()
Esempio n. 36
0
def main():
    window = MyGame(screen_width, screen_height, screen_title)
    window.setup()
    arcade.run()
Esempio n. 37
0
def main():
    window = MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.start_snowfall()
    arcade.run()
Esempio n. 38
0
def main():
    game = MyGame()
    game.setup()
    arcade.run()
Esempio n. 39
0
def main():
    window = MyWindow()
    window.start_new_game()
    arcade.run()
Esempio n. 40
0
def main():
    window = Window()
    window.setup()
    arcade.run()
Esempio n. 41
0
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.start_new_game()
    arcade.run()
 def run(self, time_interval):
     # Enable fixed interval timer
     arcade.schedule(self.tick_game, time_interval)
     arcade.run()
Esempio n. 43
0
 def run():
     return arcade.run()
Esempio n. 44
0
def main():
    """ Run the game """
    window = MyGame()
    window.setup()
    arcade.run()
Esempio n. 45
0
def main():
    window = MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.start_new_game()
    arcade.run()
Esempio n. 46
0
def main():
    window = MyGame(SW, SH, "BB8 Explosions")
    window.reset()
    arcade.run()
Esempio n. 47
0
def main():
    window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT,
                           title="Keyboard control")
    window.setup()
    arcade.run()
Esempio n. 48
0
def main():
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    arcade.run()
Esempio n. 49
0
    def on_mouse_motion(self, x, y, dx, dy):
        """
        Called whenever the mouse moves.
        """
        self.player_sprite.center_x = x
        self.player_sprite.center_y = y

    def animate(self, delta_time):
        """ Movement and game logic """

        # Call update on all sprites (The sprites don't do much in this
        # example though.)
        self.all_sprites_list.update()

        # Generate a list of all sprites that collided with the player.
        hit_list = \
            arcade.check_for_collision_with_list(self.player_sprite,
                                                 self.coin_list)

        # Loop through each colliding sprite, remove it, and add to the score.
        for coin in hit_list:
            coin.kill()
            self.score += 1


window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT)
window.setup()

arcade.run()
Esempio n. 50
0
def main():
    MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.run()