diff --git a/CHANGELOG.md b/CHANGELOG.md index ec938eb..aef27ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 0.11.3 + +- Add up to 3.13 support + ### 0.11.2 - Fix: check_color diff --git a/hooman/__init__.py b/hooman/__init__.py index 65e5b2f..3cf1b7e 100644 --- a/hooman/__init__.py +++ b/hooman/__init__.py @@ -1,7 +1,7 @@ from .hooman import Hooman from .formula import * -__version__ = "0.11.2" +__version__ = "0.11.3" diff --git a/hooman/demos/test.py b/hooman/demos/test.py index 8e308ad..8c21edc 100644 --- a/hooman/demos/test.py +++ b/hooman/demos/test.py @@ -1,88 +1,12 @@ -import pygame from hooman import Hooman -import random -import math -pygame.init() +hapi = Hooman(500, 500) -window_width, window_height = 800, 600 -hapi = Hooman(window_width, window_height) +tb = hapi.text_box(10, 10, 100, params={"background_color": (100, 100, 100)}) -screen = pygame.display.set_mode((window_width, window_height)) - -bg_color = (200, 200, 200) - -ball_radius = 20 -ball_speed_x, ball_speed_y = 5, 5 -ball_color = hapi.color['blue'] - -main_ball = { - 'x': window_width // 2, - 'y': window_height // 2, - 'speed_x': random.choice([-5, 5]), - 'speed_y': random.choice([-5, 5]), - 'radius': ball_radius -} - -sec_ball = { - 'x': random.randint(0, window_width), - 'y': random.randint(0, window_height), - 'speed_x': random.choice([-3, 3]), - 'speed_y': random.choice([-3, 3]), - 'radius': ball_radius -} - -score = 0 -font = pygame.font.Font(None, 36) - -clock = pygame.time.Clock() - -running = True -while running: - for event in pygame.event.get(): - if event.type == pygame.QUIT: - running = False - - hapi.event_loop() - - main_ball['x'] += main_ball['speed_x'] - main_ball['y'] += main_ball['speed_y'] - - sec_ball['x'] += sec_ball['speed_x'] - sec_ball['y'] += sec_ball['speed_y'] - - if main_ball['x'] - main_ball['radius'] <= 0 or main_ball['x'] + main_ball['radius'] >= window_width: - main_ball['speed_x'] = -main_ball['speed_x'] - if main_ball['y'] - main_ball['radius'] <= 0 or main_ball['y'] + main_ball['radius'] >= window_height: - main_ball['speed_y'] = -main_ball['speed_y'] - - if sec_ball['x'] - sec_ball['radius'] <= 0 or sec_ball['x'] + sec_ball['radius'] >= window_width: - sec_ball['speed_x'] = -sec_ball['speed_x'] - if sec_ball['y'] - sec_ball['radius'] <= 0 or sec_ball['y'] + sec_ball['radius'] >= window_height: - sec_ball['speed_y'] = -sec_ball['speed_y'] - - distance = math.sqrt((main_ball['x'] - sec_ball['x']) ** 2 + (main_ball['y'] - sec_ball['y']) ** 2) - if distance <= main_ball['radius'] + sec_ball['radius']: - sec_ball = { - 'x': random.randint(0, window_width), - 'y': random.randint(0, window_height), - 'speed_x': random.choice([-3, 3]), - 'speed_y': random.choice([-3, 3]), - 'radius': ball_radius - } - score += 1 - - hapi.background(bg_color) - - hapi.fill(ball_color) - hapi.circle(main_ball['x'], main_ball['y'], main_ball['radius']) - - hapi.fill(hapi.color['red']) - hapi.circle(sec_ball['x'], sec_ball['y'], sec_ball['radius']) - - score_text = font.render(f"Score: {score}", True, hapi.color['black']) - hapi.screen.blit(score_text, (10, 10)) +while hapi.is_running: + hapi.background(hapi.color['white']) + tb.update() hapi.flip_display() - - clock.tick(60) \ No newline at end of file + hapi.event_loop() \ No newline at end of file diff --git a/setup.py b/setup.py index 126a42b..e8d1e58 100644 --- a/setup.py +++ b/setup.py @@ -73,6 +73,9 @@ def get_version(rel_path: str) -> str: "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], keywords="human pygame canvas api wrapper game processing", # Optional # You can just specify package directories manually here if your project is