Пример #1
0
def main():
    c = Circle()
    c.center = Point()
    c.center.x = 0
    c.center.y = 0
    c.radius = 100

    rect = Rectangle()
    rect.corner = Point()
    rect.corner.x = -100
    rect.corner.y = 100
    rect.width = 200
    rect.height = 300

    bob = turtle.Turtle()
    draw_circle(bob, c)
    draw_rectangle(bob, rect)
    turtle.mainloop()
Пример #2
0
                guide.color = (255, 255, 255)
        if event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                drawMode = True
            if event.button == 4:
                brush.radius += 4
                guide.radius += 4
            if event.button == 5:
                brush.radius -= 4
                guide.radius -= 4
        if event.type == pygame.MOUSEBUTTONUP:
            if event.button == 1:
                drawMode = False
        print(event)

    brush.center = (pygame.mouse.get_pos()[0], pygame.mouse.get_pos()[1])

    guide.center = (pygame.mouse.get_pos()[0], pygame.mouse.get_pos()[1])

    if not alt and drawMode:
        brush.draw()
        guide.color = (255, 255, 255)
    else:
        guide.color = (128, 128, 128)
    guide.draw()

    pygame.display.update()

    gameDisplay.blit(overlay, [0, 0])

    clock.tick(10000)