Python Forum
Why the heck is this not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why the heck is this not working
#1
Hey, so I'm new here and don't plan to use this website again.
The only reason I'm here is because I've spent ages trying to get this code to work and it won't
I think there's something wrong with my computer.

Pygame doesn't seem to register when I do things.
I've altered this code like 99999 times and it hasn't shown a sign of working once. It just lets me type and nothing else happens. Here's what it is at the moment:
import pygame

pygame.init()

while True:
    pressed = pygame.key.get_pressed()
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
            if pressed[pygame.K_w]:
                print("w is pressed")
            elif pressed[pygame.K_s]:
                print("s is pressed")
please help asap
Reply


Messages In This Thread
Why the heck is this not working - by YTPizzer - Feb-16-2019, 05:06 AM
RE: Why the heck is this not working - by Windspar - Feb-16-2019, 12:36 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020