

import pygame as pg
import random, math

pg.init()

pg.display.set_caption("Gusenica")
(sirina, visina) = (600, 300)
prozor = pg.display.set_mode((sirina, visina))

elipsa = 78
broj_delova = 11
prozor.fill((255,255,255))

#telo
for i in range(broj_delova):
    BOJA=(random.randint(0,255),random.randint(0,255),random.randint(0,255))
    pg.draw.ellipse(prozor, BOJA, (50+i*elipsa//2, 2*visina//3 - elipsa//4, elipsa//2, elipsa))

#glava
pg.draw.circle(prozor, pg.Color("yellow"), (500, 120), 70)
pg.draw.circle(prozor, pg.Color("black"), (470, 95), 10)
pg.draw.circle(prozor, pg.Color("black"), (530, 95), 10)

pg.draw.arc(prozor,pg.Color("red"), (470, 100, 70, 70), math.radians(-175), math.radians(-5), 5)

#antene
pg.draw.circle(prozor, pg.Color("orange"), (420, 40), 15)
pg.draw.circle(prozor, pg.Color("orange"), (470, 20), 15)
pg.draw.line(prozor, pg.Color("orange"),(420,40),(450,70),5)
pg.draw.line(prozor, pg.Color("orange"),(470,20),(500,50),5)



pg.display.update()
while pg.event.wait().type != pg.QUIT:
    pass
pg.quit()





