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()
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()
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()
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()
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()
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()
def main(): """ Main method """ window = GameWindow(1280, 1024, SCREEN_TITLE) window.setup() arcade.run()
def main(): window = MyGame() window.setup() arcade.run()
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()
def main(): game = MyGame(600, 600, 'Drawing Example', arcade.color.WHEAT) game.position = 100 game.velocity = 700 arcade.run()
def main(): MyGame(SCREEN_WIDTH, SCREEN_HEIGHT) arcade.run()
def main(): window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT) window.setup() arcade.run()
def main(): arcade.run()
def main(): Render(SW, SH, "Snow") arcade.run()
def main(): """ Main method """ game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) game.setup() arcade.run()
def main(): # Main Event window = View() window.setup() arcade.run()
def main(): window = Game() # Runs the setup method before anything else window.setup() arcade.run()
def main(): """ Main method """ window = Leikur() window.setup() arcade.run()
def main(): window = MyGame() window.start_new_game() arcade.run()
def draw(information): """ Main method. Denna funktion anropar hela denna fil """ game = PlacementDraw(SCREEN_WIDTH, SCREEN_HEIGHT, information) game.setup() arcade.run()
def main(): """ Main method """ game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT) game.setup() arcade.run()
def main(): MyGame(600, 600, 'My Game') arcade.run()
def main(): Main_Window().start_new_game() run()
def main(): window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) start_view = InstructionView() window.show_view(start_view) arcade.run()
def main(): window = MyApp(600, 600) window.setup() arcade.run()
def start(): arcade.run()
def main(): window = MyGame(640, 480, "Drawing Example") arcade.run()
def main(): window = Render(screen_width, screen_height, 'Boxes') arcade.run()
def main(): window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) window.setup() arcade.run()
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()
def main(): """ Main method """ window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) window.setup() arcade.run()
def main(): MyAppWindow() arcade.run()
def main(): """ Main method """ window = MyGame() window.setup() arcade.run()
def main(): MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT) arcade.run()
def main(): window = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT) window.setup() arcade.run()
def main(): window = MyGame(screen_width, screen_height, screen_title) window.setup() arcade.run()
def main(): window = MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT) window.start_snowfall() arcade.run()
def main(): game = MyGame() game.setup() arcade.run()
def main(): window = MyWindow() window.start_new_game() arcade.run()
def main(): window = Window() window.setup() arcade.run()
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()
def run(): return arcade.run()
def main(): """ Run the game """ window = MyGame() window.setup() arcade.run()
def main(): window = MyAppWindow(SCREEN_WIDTH, SCREEN_HEIGHT) window.start_new_game() arcade.run()
def main(): window = MyGame(SW, SH, "BB8 Explosions") window.reset() arcade.run()
def main(): window = MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT, title="Keyboard control") window.setup() arcade.run()
def main(): game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE) arcade.run()
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()
def main(): MyApplication(SCREEN_WIDTH, SCREEN_HEIGHT) arcade.run()