Jan-13-2020, 11:37 PM
(Jan-13-2020, 05:06 AM)xBlackHeartx Wrote: I can make no sense of that code. Also, it imports two modules I've never even heard of.You really need to learn python. Then dive into pygame.
def draw_color(surface, x, y, color, c_range, block): # Save y enter location. y_top = y # Create 3 ranges. red = range(color.r, -1, -c_range) # range(start, end, step) green = range(color.g, -1, -c_range) blue = range(color.b, -1, -c_range) # Product just let you loop through all 3 ranges in one line. for r, g, b in product(red, green, blue): pygame.draw.rect(surface, (r, g, b), (x, y, block, block)) y += block # y is greater than block time four plus y start point. if y > block * 4 + y_top: x += block # Reset y back to start location. y = y_top
99 percent of computer problems exists between chair and keyboard.