Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Take and process:
import pygame as pg
...
for e in pg.event.get():
...
if e.type == pg.KEYDOWN:
if e.key == pg.K_w:
move_up()
elif e.key == pg.K_s:
move_down()
elif ...
...
Lord, come on. First link on google!
First option:
keys = pygame.keys.get_pressed()
if keys[pygame.K_RIGHT] and keys[pygame.K_LEFT]:
move_fullcube = left
right_pressed = False
one_pressed = False
for event in pygame.event.get():
if event.type==KEYDOWN:
if event.key==K_RIGHT:
right_pressed = True
if event.key==K_1:
right_pressed = True
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question