Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame.surface
#3
Thanks windspar,
The
startPosX = list(range(50, 450, 50))
worked.

But can't get the starpath to work.
This is fine a star falls from top of screen to bottom
starColor = pygame.image.load('purple_star.png')
screen.blit(starColor, (starX, starY))
This works
prints a random star to screen
imagelist = [filename for filename in cd.iterdir() if filename.suffix in ['.png', '.jpg', '.bmp']]
print (random.choice(imagelist))
What I want is to get the random star to fall
starColor = random.choice(imagelist)
screen.blit(starColor, (starX, starY))
Reply


Messages In This Thread
pygame.surface - by Graham - Nov-28-2018, 12:52 PM
RE: pygame.surface - by Windspar - Nov-28-2018, 01:41 PM
RE: pygame.surface - by Graham - Nov-28-2018, 05:39 PM
RE: pygame.surface - by Windspar - Nov-29-2018, 02:02 AM
RE: pygame.surface - by Graham - Nov-29-2018, 09:13 AM
RE: pygame.surface - by Windspar - Nov-29-2018, 02:33 PM
RE: pygame.surface - by Graham - Nov-29-2018, 03:20 PM
RE: pygame.surface - by Windspar - Nov-29-2018, 03:22 PM
RE: pygame.surface - by Graham - Nov-29-2018, 03:57 PM
RE: pygame.surface - by Windspar - Nov-29-2018, 04:21 PM
RE: pygame.surface - by nilamo - Nov-29-2018, 04:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Surface and rectangle in pygame Fabrizio_fg 6 2,574 May-27-2023, 09:15 AM
Last Post: Fabrizio_fg
  [PyGame] Pygame is treating blob_group as a surface, when I need it to treat it as a Sprite. Swagford 1 1,378 Jan-24-2023, 09:58 PM
Last Post: metulburr
  Coloring a surface with transparency Sandor 4 2,420 Jan-02-2022, 08:11 AM
Last Post: Sandor
  Drawn line shift when that surface is copied to another in pygame Leo_Red 4 3,424 Feb-11-2021, 06:33 AM
Last Post: Leo_Red
  [PyGame] pygame.Surface.fill help Shemira 3 6,302 Nov-29-2019, 12:01 AM
Last Post: Shemira
  [PyGame] PLEASE HELP! TypeError: unsupported operand type(s) for +: 'pygame.Surface' and 'int' keyfive 1 5,382 Jun-19-2018, 01:20 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

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