Quantcast
Channel: Forum Pasja Informatyki - Najnowsze pytania bez odpowiedzi
Viewing all articles
Browse latest Browse all 21942

problem ze zdarzeniami - pygame

$
0
0

Witam.

mam taki kod:

        for event in pg.event.get():
            if event.type == pg.KEYDOWN:
                if event.key == pg.K_a:
                    self.rot_speed = -PLAYER_ROT_SPEED
                    self.vel = vec(PLAYER_SPEED, 0).rotate(-self.rot)
                if event.key == pg.K_d:
                    self.rot_speed = PLAYER_ROT_SPEED
                    self.vel = vec(PLAYER_SPEED, 0).rotate(-self.rot)

Problem w tym, że ten kod się nie wykonuje!

Pętla w którym znajduje się ten bloczek wykonuje się na pewno, sprawdzałem wpisując obok tego bloczka "print("cokolwiek")", natomiast po umieszczeniu polecenia w "if event.key == klawisz:" nic się nie wypisuje.

Pomocy!


Viewing all articles
Browse latest Browse all 21942