Initial commit

This commit is contained in:
Martin Dvořák 2026-06-05 08:22:56 +02:00
commit 88ebab1503
9 changed files with 679 additions and 0 deletions

7
render.py Normal file
View file

@ -0,0 +1,7 @@
import pygame # imports pygame obviously
def load_sprite(sheet, x, y, width, height, screen_width, screen_height): # the function for our sprite rendering function
rect = pygame.Rect(x, y, width, height) # this defines our cutout from the sprite sheet its like position; size
sprite = sheet.subsurface(rect) # this goes on to cut it from the sheet actually
scaled = pygame.transform.scale(sprite, (screen_width, screen_height)) # this scales the cutout to what we want/what we chose
return scaled # this returns our cutout