School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,358 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,923 people online right now. Registration is fast and FREE... Join Now!




[pygame] why isnt my keyboard code being detected?

 

[pygame] why isnt my keyboard code being detected?

xZachtmx

14 Jun, 2009 - 02:26 PM
Post #1

New D.I.C Head
*

Joined: 14 Jun, 2009
Posts: 38



Thanked: 1 times
My Contributions
I have yet another question for this community tongue.gif

here is my code from pygame where it detects which keys are down and its supposed to exit when the escape key is pressed and the ship is supposed to turn left when the left key if pressed but none of those happen...
CODE
    

keyBState = pygame.key.get_pressed()
    
if keyBState[K_ESCAPE]:
        exit()
elif keyBState[K_RIGHT]:
        ship.turn(playerShip, frameRate / playerShip.turningSpeed)



Any ideas?

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 07:37PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month