Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualPolarist

Posted 08 February 2013 - 07:40 AM

I believe you're using the wrong information.  I believe what you want to do is use key.get_pressed:

 

for k in key_states:
     if k.key.get_pressed():
          dy = -1 * MOVESPEEDY * dt
      #etc for all the movement keys

 

For more info:  http://www.pygame.org/docs/ref/key.html#pygame.key.get_pressed

 

Hope this helps.

 

Disclaimer: I've never used pygame, and I'm not very good at python. =p

 

not sure which engine or language your using

He's using python and pygame, fyi.


#2Polarist

Posted 08 February 2013 - 07:39 AM

I believe you're using the wrong information.  I believe what you want to do is use key.get_pressed[K_whatever]:

 

for k in key_states:
     if k.key.get_pressed():
          dy = -1 * MOVESPEEDY * dt
      #etc for all the movement keys

 

For more info:  http://www.pygame.org/docs/ref/key.html#pygame.key.get_pressed

 

Hope this helps.

 

Disclaimer: I've never used pygame, and I'm not very good at python. =p

 

not sure which engine or language your using

He's using python and pygame, fyi.


#1Polarist

Posted 08 February 2013 - 07:38 AM

I believe you're using the wrong information.  I believe what you want to do is use key.get_pressed[K_whatever]:

 

for k in key_states:
     if k.key.get_pressed[pygame.K_UP]:
          dy = -1 * MOVESPEEDY * dt
      #etc for all the movement keys

 

For more info:  http://www.pygame.org/docs/ref/key.html#pygame.key.get_pressed

 

Hope this helps.

 

Disclaimer: I've never used pygame, and I'm not very good at python. =p

 

not sure which engine or language your using

He's using python and pygame, fyi.


PARTNERS