0

While I was editing some errors some errors appeared without changing a thing about his

import pygame as pg
import sprites
import time
#modules

WIDTH, HEIGHT = 1600, 900
WIN = pg.display.set_mode((WIDTH, HEIGHT))
pg.display.set_caption('Shootshoot')
#screen setup

GRAY = (124, 115, 133)
FPS = 60
#variables
sprite_sheet_image = pg.image.load('spritesheet_character.png').convert_alpha()
sprite_sheet = sprites.SpriteSheet(sprite_sheet_image)
BLACK=(0,0,0)
player_width, player_height = 14, 17

frame_0 = sprite_sheet.get_image(0,player_width, player_height,3,BLACK)
frame_1 = sprite_sheet.get_image(1,player_width, player_height,3,BLACK)
frame_2 = sprite_sheet.get_image(2,player_width, player_height,3,BLACK)
frame_3 = sprite_sheet.get_image(3,player_width, player_height,3,BLACK)
frame_4 = sprite_sheet.get_image(4,player_width, player_height,3,BLACK)

def main():
    run = True
    clock = pg.time.Clock()
    x_pos = 400
    y_pos = 350
    while run:
        clock.tick(FPS)
        for event in pg.event.get():
            if event.type == pg.QUIT:
                run = False

            if event.type == рg.KEYDOWN:
                if event.key == pg.K_LEFT:
                    WIN.blit(frame_3, (x_pos, y_pos))
                    x_pos = x_pos - 4
                    time.sleep(0.33)
                    WIN.blit(frame_4,(x_pos, y_pos))
                    time.sleep(0.33)

                if event.key == pg.K_RIGHT:
                    WIN.blit(frame_0, (x_pos, y_pos))
                    x_pos = x_pos + 4
                    time.sleep(0.33)
                    WIN.blit(frame_1, (x_pos, y_pos))
                    time.sleep(0.33)

        WIN.fill((124, 115, 133))
        pg.display.update()


    pg.quit()
#some sexy funtions




if __name__ == "__main__":
    main()

I don't have any clue what was going on I hope you programmers of stackoverflow maybe have a solution ( here i write some bs because the post code/text ratio is low) tiger beaver pig seagull sea leopard duck lion paris

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
NewMii
  • 9
  • 2
  • 2
    Welcome to Stack Overflow. Please also include the full traceback error. – ewokx Aug 29 '22 at 08:29
  • 2
    Welcome to Stack Overflow. You need to be more specific. What was working before and isn't working anymore ? What did you change ? What does your error look like ? What don't you understand about this error ? Edit you question, so that people can actually help you. – Anto Aug 29 '22 at 09:10
  • Writing BS to fill your question isn’t the way to go. Especially when a little effort would have gotten you so much further. – nigel239 Aug 29 '22 at 09:31
  • 1
    Using a `sleep()` in a PyGame program is not usually a good idea. Use the PyGame clock to do timings and delays. – Kingsley Aug 29 '22 at 23:06

0 Answers0