Beispiel #1
0
def test_create_isometric_grid_lines():
    width = 10
    height = 10
    tile_width = 64
    tile_height = 64
    window = arcadeplus.open_window(800, 600, "Test")
    lines = arcadeplus.create_isometric_grid_lines(width, height, tile_width,
                                                   tile_height,
                                                   arcadeplus.color.BLACK, 2)

    assert lines
    arcadeplus.close_window()
Beispiel #2
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(draw, 1 / 80)

    # Run the program
    arcadeplus.run()

    # When done running the program, close the window.
    arcadeplus.close_window()
Beispiel #3
0
def test_window():
    import arcadeplus
    width = 800
    height = 600
    title = "My Title"
    resizable = True
    arcadeplus.open_window(width, height, title, resizable)

    arcadeplus.set_background_color(arcadeplus.color.AMAZON)
    w = arcadeplus.get_window()
    assert w is not None

    # Make sure the arguments get passed to the window
    assert w.width == width
    assert w.height == height
    assert w.caption == title
    assert w.resizeable is resizable

    arcadeplus.set_window(w)

    p = arcadeplus.get_projection()
    assert p is not None

    v = arcadeplus.get_viewport()
    assert v[0] == 0
    # The lines below fail. Why?
    # assert v[1] == width - 1
    assert v[2] == 0
    # assert v[3] == height - 1

    arcadeplus.start_render()
    arcadeplus.finish_render()

    def f():
        pass

    arcadeplus.schedule(f, 1 / 60)

    arcadeplus.pause(0.01)

    arcadeplus.close_window()

    arcadeplus.open_window(width, height, title, resizable)
    arcadeplus.quick_run(0.01)
Beispiel #4
0
 def on_key_press(self, key, modifiers):
     if key == arcadeplus.key.ESCAPE:
         arcadeplus.close_window()
Beispiel #5
0
 def on_update(self, delta_time):
     self.emitter.update()
     if self.emitter.can_reap():
         arcadeplus.close_window()
     self.frametime_plotter.end_frame(delta_time)