0

I haven't found a question anywhere else which matches mine, but sorry in advance if I'm duplicating. I am doing a python course and I am making a game with pgzero. I have not completed it, but I have this issue, where it doesn't display the full background. I have tried uninstalling modules, reinstalling them, checking my code, checking the internet, but I haven't found anything that helps. Here is the code I have done so far:

from random import randint

WIDTH = 800
HEIGHT = 600
CENTER_X = WIDTH / 2
CENTER_Y = HEIGHT / 2

move_list = []
display_list = []

score = 0
current_move = 0
count = 4
dance_length = 4

say_dance = False
show_countdown = True
moves_complete = False
game_over = False

dancer = Actor("dancer-start")
dancer.pos = CENTER_X + 5, CENTER_Y - 40

up = Actor("up")
up.pos = CENTER_X, CENTER_Y + 110
right = Actor("right")
right.pos = CENTER_X + 60, CENTER_Y + 170
down = Actor("down")
down.pos = CENTER_X, CENTER_Y + 230
left = Actor("left")
left.pos = CENTER_X - 60, CENTER_Y + 170

def draw():
     global game_over, score, say_dance
     global count, show_countdown
     if not game_over:
         screen.clear()
         screen.blit("stage", (0, 0))
         dancer.draw()
         up.draw()
         down.draw()
         right.draw()
         left.draw()
         screen.draw.text("Score: " +
                          str(score), color="black",
                          topleft=(10, 10))
     return

I also have an image of the pgzero window I get shown:

And this is the picture of how the background should look like:

Any support would be greatly appreciated, thanks in advance.

Aahan
  • 1
  • 3
  • Is this part of the course you are following? If so could you link to the course you are following? – GrizlerBear Oct 19 '22 at 16:04
  • Hi, this is the course I am doing, https://drive.google.com/file/d/1kw4YgvbvwVffXKabrsaYiIVwt9G_Yedk/view?usp=sharing ,I am working on Chapter 9 Dance Challenge, thanks for volunteering in advance. – Aahan Oct 19 '22 at 16:44
  • I apologize I was unable to reproduce the problem on my machine. I don't have a system running windows 11 unfortunately, perhaps there is in an issue there. I would recommend trying to change some of the values in your code (such as the width and height variables) or trying to remove pieces of code that don't relate to the background, to try and find where the problem might be coming from. Did you run into this problem with any of the other problems in this book? – GrizlerBear Oct 20 '22 at 00:17
  • Hi, thanks for you help, I have already tried changing the height and width variables, and have played around with my code, trying to see what would work already. I have not ran into this problem in the earlier gmaes, but I did do those on a different laptop with Windows 10, now I am continuing it on my new laptop with Windows 11. – Aahan Oct 20 '22 at 08:55
  • Hi, I know this is not an answer. But it has started working without me doing anything. It could have happened when I was updating my Windows 11, but I am not sure. – Aahan Oct 29 '22 at 10:12
  • That's good to hear! I'm glad your problem has sorted itself out. It was more than likely a windows 11 issue. – GrizlerBear Oct 31 '22 at 16:14

0 Answers0