コード例 #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()
コード例 #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()
コード例 #3
0
ファイル: platformer.py プロジェクト: apalm112/arcade
    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()
コード例 #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()
コード例 #5
0
ファイル: bouncing_ball.py プロジェクト: mikemhenry/arcade
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()
コード例 #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()
コード例 #7
0
def main():
    """ Main method """
    window = GameWindow(1280, 1024, SCREEN_TITLE)
    window.setup()
    arcade.run()
コード例 #8
0
def main():
    window = MyGame()
    window.setup()
    arcade.run()
コード例 #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()
コード例 #10
0
def main():
    game = MyGame(600, 600, 'Drawing Example', arcade.color.WHEAT)
    game.position = 100
    game.velocity = 700
    arcade.run()
コード例 #11
0
ファイル: perlin_noise_2.py プロジェクト: mattkw80/arcade
def main():
    MyGame(SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.run()
コード例 #12
0
ファイル: move_mouse.py プロジェクト: mikemhenry/arcade
def main():
    window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.setup()
    arcade.run()
コード例 #13
0
def main():
    arcade.run()
コード例 #14
0
def main():
    Render(SW, SH, "Snow")
    arcade.run()
コード例 #15
0
def main():
    """ Main method """
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    game.setup()
    arcade.run()
コード例 #16
0
def main():
    # Main Event
    window = View()
    window.setup()
    arcade.run()
コード例 #17
0
ファイル: game.py プロジェクト: feitianyiren/Medusa-9
def main():
	window = Game()
	# Runs the setup method before anything else
	window.setup()
	arcade.run()
コード例 #18
0
def main():
    """ Main method """

    window = Leikur()
    window.setup()
    arcade.run()
コード例 #19
0
def main():
    window = MyGame()
    window.start_new_game()
    arcade.run()
コード例 #20
0
def draw(information):
    """ Main method. Denna funktion anropar hela denna fil """
    game = PlacementDraw(SCREEN_WIDTH, SCREEN_HEIGHT, information)
    game.setup()
    arcade.run()
コード例 #21
0
def main():
    """ Main method """
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT)
    game.setup()
    arcade.run()
コード例 #22
0
def main():
    MyGame(600, 600, 'My Game')
    arcade.run()
コード例 #23
0
ファイル: __init__.py プロジェクト: xiro49/CELL_SIM
def main():
    Main_Window().start_new_game()
    run()
コード例 #24
0
def main():
    window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    start_view = InstructionView()
    window.show_view(start_view)
    arcade.run()
コード例 #25
0
ファイル: experiment.py プロジェクト: pauleveritt/asteroids
def main():
    window = MyApp(600, 600)
    window.setup()
    arcade.run()
コード例 #26
0
ファイル: game_window.py プロジェクト: Plankankul/anns
 def start():
     arcade.run()
コード例 #27
0
def main():
    window = MyGame(640, 480, "Drawing Example")

    arcade.run()
コード例 #28
0
def main():
    window = Render(screen_width, screen_height, 'Boxes')
    arcade.run()
コード例 #29
0
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.setup()
    arcade.run()
コード例 #30
0
ファイル: Pong.py プロジェクト: LMGerard/Pong
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()
コード例 #31
0
def main():
    """ Main method """
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.setup()
    arcade.run()
コード例 #32
0
ファイル: sprite_bullets.py プロジェクト: mikemhenry/arcade
def main():
    MyAppWindow()
    arcade.run()
コード例 #33
0
ファイル: main2.py プロジェクト: peyloading/E04a-Sprites
def main():
    """ Main method """
    window = MyGame()
    window.setup()
    arcade.run()
コード例 #34
0
def main():
    MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.run()
コード例 #35
0
ファイル: mouse_control.py プロジェクト: rodrigodub/Output
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.setup()
    arcade.run()
コード例 #36
0
def main():
    window = MyGame(screen_width, screen_height, screen_title)
    window.setup()
    arcade.run()
コード例 #37
0
ファイル: snow.py プロジェクト: mquinson/arcade
def main():
    window = MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.start_snowfall()
    arcade.run()
コード例 #38
0
def main():
    game = MyGame()
    game.setup()
    arcade.run()
コード例 #39
0
ファイル: asteroid_smasher.py プロジェクト: mikemhenry/arcade
def main():
    window = MyWindow()
    window.start_new_game()
    arcade.run()
コード例 #40
0
ファイル: main.py プロジェクト: aidencrilley/LeapsAndBounds
def main():
    window = Window()
    window.setup()
    arcade.run()
コード例 #41
0
def main():
    window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    window.start_new_game()
    arcade.run()
コード例 #42
0
 def run(self, time_interval):
     # Enable fixed interval timer
     arcade.schedule(self.tick_game, time_interval)
     arcade.run()
コード例 #43
0
ファイル: window.py プロジェクト: xiro49/CELL_SIM
 def run():
     return arcade.run()
コード例 #44
0
ファイル: enemies.py プロジェクト: al0fayz/python-playgrounds
def main():
    """ Run the game """
    window = MyGame()
    window.setup()
    arcade.run()
コード例 #45
0
ファイル: sprite_ramps.py プロジェクト: mquinson/arcade
def main():
    window = MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT)
    window.start_new_game()
    arcade.run()
コード例 #46
0
def main():
    window = MyGame(SW, SH, "BB8 Explosions")
    window.reset()
    arcade.run()
コード例 #47
0
ファイル: move_keyboard.py プロジェクト: mwreuter/arcade
def main():
    window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT,
                           title="Keyboard control")
    window.setup()
    arcade.run()
コード例 #48
0
def main():
    game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
    arcade.run()
コード例 #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()
コード例 #50
0
def main():
    MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT)
    arcade.run()