Answers for "pygame colour detection"

2

how to detect color collision in pygame

WITHOUT ALPHA VALUE

color = (0,0,0)
while True:
    color = pygame.Surface.get_at((x,y))[:3]
    if color = (#certain value)
        #do something
        
WITH ALPHA VALUE
color = (0,0,0,0)
while True:
    color = pygame.surface.get_at((x,y))
    if color = (#certain value)
        #do somthing
Posted by: Guest on February-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language