Skip to content

Commit

Permalink
auto test
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Oct 2, 2024
1 parent 9efd070 commit ce0217b
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/test_raylib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit ce0217b

Please sign in to comment.