line=LineStyle(1,black) Petal=EllipseAsset(50,20,line, lightblue) petal2=EllipseAsset(20,50,line, lightblue) Circle=CircleAsset(30, line, purple) stem=RectangleAsset(5,100,line,green) pot=PolygonAsset([(300,500), (500,500), (450,600), (350,600), (300,500)], line, brown) Sprite(Circle, (375,300)) Sprite(Petal, (300,300)) Sprite(Petal, (450,300)) Sprite(petal2, (380,225)) Sprite(stem, (380,400)) Sprite(petal2, (380,375)) petal3=Sprite(petal2,(315,245)) petal3.rotation=3.14/4 petal4=Sprite(petal2,(430,355)) petal4.rotation=3.14/4 petal5=Sprite(Petal,(430,245)) petal5.rotation=3.14/4 petal5=Sprite(Petal,(315,355)) petal5.rotation=3.14/4 Sprite(pot) # add your code here /\ /\ /\ myapp = App() myapp.run()
Sprite(ridge, (768, 350)) Sprite(ridge, (798, 350)) Sprite(ridge, (828, 350)) Sprite(ridge1, (740, 280)) Sprite(ridge1, (760, 280)) Sprite(ridge1, (780, 280)) Sprite(ridge1, (800, 280)) Sprite(windows, (710, 540)) Sprite(windows1, (620, 410)) Sprite(windows1, (890, 410)) Sprite(windows2, (711, 505)) Sprite(windows3, (762.5, 238)) Sprite(line, (773, 505)) Sprite(plant, (175, 417)) a = Sprite(leaves, (186, 448)) a.rotation = 2.2 a = Sprite(leaves, (185, 450)) a.rotation = 3.9 a = Sprite(leaves, (185, 480)) a.rotation = 2.2 a = Sprite(leaves, (185, 490)) a.rotation = 3.9 a = Sprite(leaves, (185, 515)) a.rotation = 2.2 a = Sprite(leaves, (185, 525)) a.rotation = 3.9 a = Sprite(leaves, (185, 550)) a.rotation = 2.2 a = Sprite(leaves, (185, 560)) a.rotation = 3.9 a = Sprite(leaves, (185, 585))
thickline2 = LineStyle(5, orange) circle = CircleAsset(10, noline, beige) poly = PolygonAsset([(20,20), (30,40), (50,160), (20,100)], thickline, red) portal1 = EllipseAsset(40, 10, nlu, white) rectum = RectangleAsset(40, 60, thickline2, orange) portal2 = EllipseAsset(40, 10, thickline2, white) rectum2 = RectangleAsset(40, 30, thickline2, orange) legs = RectangleAsset(5, 30, thickline2, orange) #arm1 = #arm2 = arm1 = Sprite(legs, (130, 480)) arm2 = Sprite(legs, (30, 480)) arm1.rotation=-1 arm2.rotation=1 #arm1.roation=.5 Sprite(circle, (80, 478)) Sprite(poly, (90, 530)) Sprite(portal1, (80, 150)) Sprite(portal2, (80, 550)) Sprite(rectum, (60, 490)) Sprite(rectum2, (60, 150)) Sprite(legs, (60, 180)) Sprite(legs, (95, 180)) # add your code here /\ /\ /\
Sprite(head, (200, 200)) Sprite(nose, (300, 350)) Sprite(nostril, (318, 370)) Sprite(nostril, (361, 370)) Sprite(whiteeye, (235, 290)) Sprite(whiteeye, (400, 290)) Sprite(eye, (275, 315)) Sprite(eye, (404, 315)) Sprite(eartopl, (155, 178)) Sprite(eartopr, (435, 180)) Sprite(earbottoml, (155, 178)) Sprite(earbottomr, (475, 181)) #Sprite(body, (175, 485)) s = Sprite(shoot, (800, 335)) t = Sprite(shoot, (800, 335)) t.rotation = -.07 j = Sprite(shoot, (800, 335)) j.rotation = .07 r = Sprite(shoot, (800, 337)) r.rotation = -.1 k = Sprite(shoot, (800, 339)) k.rotation = -.15 y = Sprite(shoot, (800, 341)) y.rotation = -.2 f = Sprite(shoot, (800, 333)) f.rotation = .1 z = Sprite(shoot, (800, 331)) z.rotation = .15 d = Sprite(shoot, (800, 329)) d.rotation = .2 a = Sprite(shoot, (800, 327))
#head s = Sprite(triangle, (120, 120)) s.scale = 0.8 #ears Sprite(circle, (60, 45)) Sprite(circle, (380, 45)) #nose Sprite(smalltriangle, (294.5, 420)) #eyes Sprite(whiteeye, (225, 200)) Sprite(whiteeye, (350, 200)) Sprite(pupil, (255, 220)) Sprite(pupil, (380, 220)) #whiskers w = Sprite(whisker, (370, 330)) w.rotation = .3 W = Sprite(whisker, (370, 335)) W.rotation = 0 m = Sprite(whisker, (370, 340)) m.rotation = -.3 r = Sprite(whisker, (174, 301)) r.rotation = -.3 k = Sprite(whisker, (170, 335)) k.rotation = 0 l = Sprite(whisker, (174, 368)) l.rotation = .3 #cheese c = Sprite(cheese, (650, 245)) Sprite(cheesetop, (650, 205)) Sprite(cheesehole, (663, 260)) Sprite(cheesehole, (730, 280))
blue = Color(0x1C86EE, 1.0) white = Color(0xF8F8FF, 1.0) black = Color(0x000000, 1.0) orange = Color(0xFF7D40, 1.0) thinline1 = LineStyle(1, black) thinline = LineStyle(1, blue) #values chosen by the user h = int(input('enter the h value of a parabola in the form y=(x-h)^2+k: ')) k = int(input('enter the k value of a parabola in the form y=(x-h)^2+k: ')) #this is the image used to represent the skier skier_asset = ImageAsset("images/Python Skiier.png", Frame(0,0,685,685)) skier = Sprite(skier_asset, (50, 160)) skier.fxcenter=.6 skier.fycenter=.7 skier.scale = 0.3 skier.rotation = .3 #Here I was able to center the vertex of the parabola xfunc = lambda t: 20*t+522 #Here I used -k vs +k to account for python moving down with regard to y values. yfunc = lambda t:-((t-h)**2)-k + 600 #Here I made the jump 60 units in length as this scale was appropriate for the python grid for t in range(-30, 30): Ypoints = yfunc(t) Xpoints = xfunc(t) #Here the actual circles are plotted which together form a parabola shape simmilar to ski jump point = CircleAsset(8, thinline, white) Sprite(point, (Xpoints, Ypoints)) print(' ') #What is going on here? #for t in range(-10000,56): # deriv = 2*(t-h)
thickline = LineStyle(5, red) thickline2 = LineStyle(5, orange) circle = CircleAsset(10, noline, beige) poly = PolygonAsset([(20, 20), (30, 40), (50, 160), (20, 100)], thickline, red) portal1 = EllipseAsset(40, 10, nlu, white) rectum = RectangleAsset(40, 60, thickline2, orange) portal2 = EllipseAsset(40, 10, thickline2, white) rectum2 = RectangleAsset(40, 30, thickline2, orange) legs = RectangleAsset(5, 30, thickline2, orange) #arm1 = #arm2 = arm1 = Sprite(legs, (130, 480)) arm2 = Sprite(legs, (30, 480)) arm1.rotation = -1 arm2.rotation = 1 #arm1.roation=.5 Sprite(circle, (80, 478)) Sprite(poly, (90, 530)) Sprite(portal1, (80, 150)) Sprite(portal2, (80, 550)) Sprite(rectum, (60, 490)) Sprite(rectum2, (60, 150)) Sprite(legs, (60, 180)) Sprite(legs, (95, 180)) # add your code here /\ /\ /\ myapp = App()
#pikachu Sprite(ears, (160,125)) Sprite(ears2, (100,125)) Sprite(face, (130,150)) Sprite(cheeks, (135,180)) Sprite(cheeks, (175,180)) Sprite(tip, (200,125)) Sprite(tip2, (100,125)) Sprite(mouth, (152,195)) Sprite(mouth2,(155,191.5)) Sprite(mouth3,(157,191.5)) Sprite(mouth, (160,195)) Sprite(nose, (156, 186)) Sprite(eye, (142,170)) Sprite(eye,(171,170)) Sprite(shiny,(143.5,170)) Sprite(shiny,(171.5,170)) s = Sprite(arm, (140,215)) s.rotation = 0.3 g = Sprite(arm, (170,210)) g.rotation = -0.3 Sprite(box2,(140,210)) Sprite(box2,(170,210)) # add your code here /\ /\ /\ myapp = App() myapp.run()
windshield = RectangleAsset(30, 140, noline, translucent) handle = RectangleAsset(20, 5, noline, white) # Now display a rectangle #Car one Sprite(rectangle, (100, 200)) Sprite(circle, (475, 400)) Sprite(circle, (225, 400)) Sprite(cartriangle1, (100, 200)) Sprite(cartriangle2, (600, 200)) Sprite(window1, (330, 275)) Sprite(window1, (495, 275)) Sprite(lights, (100, 360)) s1 = Sprite(windshield, (237, 220)) s1.rotation = -0.9 Sprite(handle, (320, 325)) Sprite(handle, (485, 325)) #Car two Sprite(rectangle2, (700, 200)) Sprite(circle, (1075, 400)) Sprite(circle, (825, 400)) Sprite(cartriangle1, (700, 200)) Sprite(cartriangle2, (1200, 200)) Sprite(window1, (930, 275)) Sprite(window1, (1095, 275)) Sprite(lights, (700, 360)) s2 = Sprite(windshield, (837, 220)) s2.rotation = -0.9 Sprite(handle, (920, 325))