Jun-03-2018, 02:35 AM
In the program I'm working on, the IDLE keeps indenting by 29 columns instead of 4 after defining a function. I'm not sure why and I'd appreciate some help fixing this!
def drawIcon(shape, color, boxx, boxy): quarter = int(BOXSIZE * 0.25) half = int(BOXSIZE * 0.5) left, top = leftTopCoordsOfBox(boxx, boxy) if shape == DONUT: pygame.draw.circle(DISPLAYSURF, color, (left + half, top + half), quarter - 5) elif shape == SQUARE: pygame.draw.rect(DISPLAYSURF, color, (left + quarter, top + quarter, BOXSIZE - half, BOXSIZE - half)) elif shape == DIAMOND: pygame.drawpolygon(DISPLAYSURF, color, ((left + half, top), (left + BOXSIZE - 1, top + half), (left + half, top + BOXSIZE - 1), (left, top + half))) elif shape == LINES: for i in range(0, BOXSIZE, 4): pygame.draw.line(DISPLAYSURF, color, (left, top + i), (left + i, top)) pygame.draw.line(DISPLAYSURF, color, (left + i, top + BOXSIZE - (left + BOXSIZE - 1, top + i)) elif shape == OVAL: pygame.draw.elipse(DISPLAYSURF, color, (left, top + quarter, BOXSIZE, half)) def getShapeAndColor(board, boxx, boxy): #place it indents to