I am developing a game and have encountered a few unsolvable (by me at least) issues.
Problems that I have with my code are:
When asking if you want to save a screenshot, only inputting anything which can be translated, by the
lower()method, into either"yes"or"no"will be accepted despite theorstatement - one of the conditions in that code block isif save_option.lower() == ("yes" or "y"):and it will only accept"yes", or else the condition is evaluated asFalse. I don't know why this is.When rendering the introduction to the game in
def introduction():, for some reason, each surface object is getting drawn twice. Here is what it looks like:
However, when I increase the pixels moved every frame to 60, this happens:

When 'deliver all his presents' reaches the top of the screen,
introduction()ends and the main game loop starts. I can see any logic error relating to this in this bit of code:while not pygame.sprite.Group.has(intro_story_surface_objects): for event in pygame.event.get(): if event.type == QUIT or event.type == KEYDOWN and event.key
== K_ESCAPE: destroy()DS.blit(BACKGROUND, (0, 0)) pygame.draw.rect(DS, (0, 0, 0, 50), (0, DISPLAY_HEIGHT - 200, DISPLAY_WIDTH, 200), 0) # (screen, color, (x,y,width,height), thickness) count = 0 for line in intro_story_surface_objects: line_x_y = (intro_story_surface_objects[line].rect.x, intro_story_surface_objects[line].rect.y) intro_story_sprite_group.draw(DS) intro_story_surface_objects[line].rect.y -= 60 # intro_story_surface_objects[line].speed if intro_story_surface_objects[line].rect.y + intro_story_surface_objects[line].rect.height < 0: intro_story_surface_objects[line].kill() # print("Kill") line_kills += 1 if line_kills == len(intro_story_surface_objects): return pygame.display.update() clock.tick(30)
Thanks again, in advance for trying to help.
From Kiran