Bump engine submodule and quit with a click or by pressing q.
This commit is contained in:
parent
7ed23a5d5f
commit
119cd76156
2
engine
2
engine
@ -1 +1 @@
|
|||||||
Subproject commit 61cfdbccf3230b73d42eb90f6eec934dbe1ddfdb
|
Subproject commit 65b25c8be37aff5ab94c1c0b5a1410afa8a87f2b
|
13
game/game.py
13
game/game.py
@ -153,8 +153,7 @@ def main():
|
|||||||
cube_orientation = tests_batch.params[cube_id].orientation
|
cube_orientation = tests_batch.params[cube_id].orientation
|
||||||
clouds_orientation = tests_batch.params[clouds_id].orientation
|
clouds_orientation = tests_batch.params[clouds_id].orientation
|
||||||
|
|
||||||
print("Running...")
|
print("Running... Click or press q to quit")
|
||||||
events = buffer(Event, 16)
|
|
||||||
start_time = time.monotonic()
|
start_time = time.monotonic()
|
||||||
current_time = 0.0
|
current_time = 0.0
|
||||||
frame_min = 10000.0
|
frame_min = 10000.0
|
||||||
@ -164,6 +163,7 @@ def main():
|
|||||||
draw_max = 0.0
|
draw_max = 0.0
|
||||||
draw_avg = 0.0
|
draw_avg = 0.0
|
||||||
perf_count = 0
|
perf_count = 0
|
||||||
|
events = buffer(Event, 16)
|
||||||
try:
|
try:
|
||||||
for frame in range(10000):
|
for frame in range(10000):
|
||||||
current_time = time.monotonic() - start_time
|
current_time = time.monotonic() - start_time
|
||||||
@ -244,8 +244,13 @@ def main():
|
|||||||
if not nevents:
|
if not nevents:
|
||||||
break
|
break
|
||||||
for event in events[:nevents]:
|
for event in events[:nevents]:
|
||||||
if event.type == EVENT_KEY_RELEASE:
|
if event.type == EVENT_FOCUS_IN:
|
||||||
print("EVENT_KEY_RELEASE:", event.data.key.keycode)
|
print("EVENT_FOCUS_IN")
|
||||||
|
elif event.type == EVENT_FOCUS_OUT:
|
||||||
|
print("EVENT_FOCUS_OUT")
|
||||||
|
elif event.type == EVENT_KEY_PRESS and event.data.key.character == 'q':
|
||||||
|
stop = True
|
||||||
|
elif event.type == EVENT_BUTTON_RELEASE:
|
||||||
stop = True
|
stop = True
|
||||||
if stop:
|
if stop:
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user