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(s50): Growing=False elif (s20): 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 ###
Información del documento
- Subido en
- 6 de marzo de 2024
- Número de páginas
- 7
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas