ok i have this code so far
Code:import pygame from pygame.locals import* pygame.init() gamePlaying = True shipPos = 512,333 #while gamePlaying: # initializing the game window gameWindow = pygame.display.set_mode((1024, 768), FULLSCREEN ) pygame.display.set_caption('STARBOUND') screen = pygame.display.get_surface() #loading textures # ship sprites podTex = 'shipPlaceholder.png' podSprite = pygame.image.load(podTex).convert_alpha() keyBState = pygame.event.get() #drawing code screen.blit(podSprite, (shipPos)) pygame.display.update()
so i want to make the little sprite i have move when a key is pressed but im not sure now... i just want to know the code i alredy know how to make it's position changed when the event happenes
Last edited by WingedPanther; 06-13-2009 at 12:29 PM. Reason: add code tags (the # button)
You may also want to look at KEYUP vs. KEYDOWN to see which would better suit your needs.Code:for event in keyBState: if event.type == KEYDOWN: if (event.key == K_LEFT): //move ship left
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks