added all the comments, ALL OF THEM

This commit is contained in:
dvorakmortonxd 2026-05-29 13:29:26 +02:00
commit b0bafa7503
3 changed files with 60 additions and 61 deletions

View file

@ -1,7 +1,7 @@
import pygame
import pygame # imports pygame obviously
def load_sprite(sheet, x, y, width, height, screen_width, screen_height):
rect = pygame.Rect(x, y, width, height)
sprite = sheet.subsurface(rect)
scaled = pygame.transform.scale(sprite, (screen_width, screen_height))
return scaled
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