How do I add a line as a sprite in pygame?
问题 I want to add a grid to my level that stays with the terrain and not the screen. The way I thought of doing it is to add all the lines that form the grid as sprites and move them with the terrain, but I can't figure out how to represent the line as an image. I tried to do this myself, but had no success. EDIT: Here's what I've tried class Grid(): def __init__(self): self.grid = pygame.Surface(size) self.grid.set_colorkey((0,0,0)) def draw(self): # DRAW TILE LINES -----------------------------