From 09be12d6ea2ac9511c31047fc9b35613175d95bf Mon Sep 17 00:00:00 2001 From: TRS_MML Date: Fri, 13 Jun 2025 22:06:47 +0100 Subject: [PATCH] put everything on a surface, so we can stack other suraces and hopefully not cry --- __main__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/__main__.py b/__main__.py index e33823e..e7e8796 100644 --- a/__main__.py +++ b/__main__.py @@ -1,8 +1,8 @@ import pygame from random import randint -screenx = 1280 -screeny = 720 +screenw = 1280 +screenh = 720 yOffset = 0 pygame.init() @@ -13,7 +13,8 @@ GunShot = pygame.mixer.Sound("sfx/gun-shot.mp3") GunSpin = pygame.mixer.Sound("sfx/gun-spin.mp3") -screen = pygame.display.set_mode((screenx,screeny)) +screen = pygame.display.set_mode((screenw,screenh)) +MainSurface = pygame.Surface((screenw,screenh-yOffset)) clock = pygame.time.Clock() running = True #you better start running... @@ -24,8 +25,8 @@ while running: screen.fill("black") - fireButton = pygame.Rect(0,0,300,100) - pygame.draw.rect(screen, (30,30,30), fireButton) + pygame.draw.rect(MainSurface, (30,30,30), (0,0,300,100)) + screen.blit(MainSurface,(0,yOffset)) pygame.display.flip()