Computer Science CMU academy 2024
Rotating star - ️️round = gradient('black', 'midnightBlue', 'blue', start='left-top') # background Polygon(0, 0, 400, 220, 400, 400, 220, 400, fill='white', opacity=30) # halo and the star halo = Circle(0, 0, 30, fill=gradient('white', 'gold'), opacity=50) Growing = True star = Star(0, 0, 1, 5, fill=gradient('lightYellow', 'gold')) def onKeyHold(keys): # Check if the halo is growing and add or subtract accordingly from its size. ### Place Your Code Here ### if(Growing==True): s+=1 else: s-=1 # If the radius is bigger than 50 or smaller than 20, change Growing. ### Place Your Code Here ### if(s>50): Growing=False elif (s<20): Growing=True # If right is held, increase the centerX, centerY, and rotateAngle by 5 # and the radius by 1. Also, wrap around from right-bottom corner to left-top # corner and reset the radius of the star to 1. ### Place Your Code Here ###
Written for
- Institution
- Computer Science CMU
- Course
- Computer Science CMU
Document information
- Uploaded on
- March 6, 2024
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
computer science cmu academy
Also available in package deal