From ce0217b2b9c73eb45d74e7798abe16c26750e628 Mon Sep 17 00:00:00 2001 From: pmp-p Date: Thu, 3 Oct 2024 01:26:36 +0200 Subject: [PATCH] auto test --- src/test_raylib.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test_raylib.py b/src/test_raylib.py index 13ab9b8..8bfc656 100644 --- a/src/test_raylib.py +++ b/src/test_raylib.py @@ -40,7 +40,10 @@ def fs_decode(fsname, o248): async def main(): - MAX_BUNNIES = 500000 + try: + MAX_BUNNIES = int(sys.argv[-1]) + except: + MAX_BUNNIES = 10000 # This is the maximum amount of elements (quads) per batch # NOTE: This value is defined in [rlgl] module and can be changed there @@ -80,24 +83,21 @@ def __init__(self): SetTargetFPS(60); # Set our game to run at 60 frames-per-second #//-------------------------------------------------------------------------------------- + await asyncio.sleep(0) + for i in range(0, MAX_BUNNIES): + bunnies[bunniesCount].position_x = 100 + bunnies[bunniesCount].position_y = 100 + bunnies[bunniesCount].speed_x = random.randint(-250, 250)/60.0 + bunnies[bunniesCount].speed_y = random.randint(-250, 250)/60.0 + bunnies[bunniesCount].color_r = random.randint(50,240) + bunnies[bunniesCount].color_g = random.randint(80, 240) + bunnies[bunniesCount].color_b = random.randint(100, 240) + bunnies[bunniesCount].color_a = 255 + bunniesCount+=1 + + #// Main game loop while not WindowShouldClose(): #// Detect window close button or ESC key - #// Update - #//---------------------------------------------------------------------------------- - if IsMouseButtonDown(MOUSE_BUTTON_LEFT): - #// Create more bunnies - for i in range(0, 100): - if bunniesCount < MAX_BUNNIES: - bunnies[bunniesCount].position_x = GetMousePosition().x - bunnies[bunniesCount].position_y = GetMousePosition().y - bunnies[bunniesCount].speed_x = random.randint(-250, 250)/60.0 - bunnies[bunniesCount].speed_y = random.randint(-250, 250)/60.0 - bunnies[bunniesCount].color_r = random.randint(50,240) - bunnies[bunniesCount].color_g = random.randint(80, 240) - bunnies[bunniesCount].color_b = random.randint(100, 240) - bunnies[bunniesCount].color_a = 255 - bunniesCount+=1 - # // Update bunnies for i in range(0, bunniesCount):