Python Forum
Rocket will only move in two directions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rocket will only move in two directions
#4
Looks like your code is way more complicated than necessary. Why just do something like,

if keystate[pygame.K_LEFT]:
  dx = -1
elif keystate[pygame.K_RIGHT]:
 dx = 1
elif keystate[pygame.K_UP]:
 dy = -1
...
Reply


Messages In This Thread
RE: Rocket will only move in two directions - by MK_CodingSpace - Dec-10-2020, 04:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Snake not changing directions in Snake Game Bjdamaster 4 6,475 Aug-13-2018, 05:09 AM
Last Post: Bjdamaster

Forum Jump:

User Panel Messages

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