count1
blit
player()
def fonar(pustota, pustota1): if event.type == pg.KEYDOWN: if event.key == pg.K_SPACE: win.blit(pustota1, (-670,0)) if event.type == pg.KEYUP: if event.key == pg.K_SPACE: win.blit(pustota, (-670,0)) def player(pustota, xm, count1): win.blit(screen, (0, 0)) if xm <= 200: screen.blit(pustota, (count1+1, 0)) print(count1) import pygame as pg pg.init() win = pg.display.set_mode((1300, 600)) sc = pg.display.set_mode((1300, 600)) screen = pg.Surface((1300, 600)) #icon = pg.image.load('C:\Distr\python\Five-nights-at-Snusiks\Images\icon.png') pustota = pg.image.load('C:\Distr\python\Five-nights-at-Snusiks\Images\pustota.png') pustota1 = pg.image.load('C:\Distr\python\Five-nights-at-Snusiks\Images\pustota1.png') pg.display.set_caption("Fnas") run = True b1 = True f1 = pg.font.Font(None, 25) #pg.display.set_icon(icon) keys = pg.key.get_pressed() clock = pg.time.Clock() pg.display.update() count1 = -670 while run: clock.tick(60) for event in pg.event.get(): if event.type == pg.QUIT: run = False fonar(pustota, pustota1) xm, ym = pg.mouse.get_pos() text1 = f1.render(f'Mouse position: {xm} {ym}', 1, (0,0,0)) player(pustota, xm, count1) if event.type == pg.KEYDOWN: if event.key == pg.K_g: b1 = False if event.key == pg.K_h: b1 = True if b1 == False: win.blit(text1, (5,5)) print(count1) pg.display.update() pg.quit()
P.S. Сори за грязный код