02-24 App Lab Animation
Web site: bit.ly/cs100 Report video/sound issues using the video being off form
Announcements:
Previously:� CPX Sensors: Sound, Light, Temp�
Today:
Animation (no CPX needed)�
Take today’s quiz, using the link posted in the Zoom chat.
UIC CS100, Reed, Spring 2021
Sign Up for your breakout group (3 min)
Intro question:
If there was no pandemic, at what restaurant would you want to go eat?�As a group choose a favorite and put information about it in the upper-right of your page.��
Start with: https://studio.code.org/projects/applab/wiy8SmTBsKgCZ0w0ckkbSFaMdziZ5Al-U-WoEsm9dIs
First person in your group screen share.�As a group look through the code and decide on and write down on your page:
2. Event Loop Animation (7 min)
Start with:
Second person in your group screen share.�As a group look through the code and decide on and write down on your page:
Screen Position Values (4 min)
x, y�0, 0
x gets bigger
x, y�320, 0
x, y�320, 450
x, y�0, 450
y gets bigger
x, y
Position of an object is relative to the x,y values of the upper-left corner of the bounding box:
3. Ball Bounces (6 min)
Start with: https://studio.code.org/projects/applab/46PA0YHXaKdO4fUDP_UOglzMZ81vR3tsvbB00uEDZ_c
As a group look through the code and notice the code used to make it bounce off the left wall.
The third person in your group screen share.�As a group write the code to do the following:
Sprite Intersection (4 min)
For bounding-box intersection to be true, the following must be true:
Does this algorithm still work if we swap shell and ball in the statements above?��Complete the code so it works.
4. Ball and Shell Intersect (6 min)
Start with: https://studio.code.org/projects/applab/k3Y_hH6r1WD4DAKBMJxfK9vLHz2g-WG9tcdIjhSqOiQ
Fourth person screen share.�As a group look through the code and pay particular attention to:�����Complete the code so that when the ball intersects the shell, the ball image changes to the deflated ball and the program stops.
5. Screen Wrap-around (for lab)
Start with: https://studio.code.org/projects/applab/lVUJ7A7LdJu44qzD5UBSUzxrH0cwlGPH2ofHGLFxpkc
Left/Right arrow keys moves seagull, which wraps around when it reaches the edge of the screen. Complete the code so that it also works to wrap around top and bottom.���
Brainstorm (time permitting)
Given what we’ve seen about how to do animation:
1
Breakout Group
Group Member Names:
Cecilia/Lee Teppema | Hieu Nguyen |
Melanie Pureza | Colin Kendall |
Use your color for your contributions.
Only stops when you press a different key. ��
Restaurant recommendation: Joy Yee��
2
Breakout Group
Group Member Names:
Use your color for your contributions.
Tarun Balanagraj (moved to group 8) | Name 3 |
Name 2 | Name 4 |
Restaurant recommendation: Nando’s
3
Breakout Group
Group Member Names:
Use your color for your contributions.
Dev Patel | David Bekov |
Grace Ryu | Johana Cantor |
Restaurant recommendation: Chicago Pizza and Oven Grinder, Chipotle��
4
Breakout Group
Group Member Names:
Use your color for your contributions.
Lisa McClay | Angelo Sieling |
Karen Davalos | Iker Carranza |
How to do a floating animation?
More difficult to control the ball�The ball doesn’t come back once it goes off the screen�The ball feels like a real ball, where energy is needed to stop it.
Restaurant recommendation: Los Comales��
5
Breakout Group
Group Member Names:
Use your color for your contributions.
Lena Searcy | Name 3 Ethan Potts |
Kat Svadlena | Ammar ahmed mohammed |
Seems to not work properly after running and resetting it.�
On a timed loop that updates the position every 40 seconds�Making sure the ball doesn’t leave the windows
Restaurant recommendation: Suhi, Ramen places. ��
6
Breakout Group
Group Member Names:
Use your color for your contributions.
Zabdi Herrera | Vatsal Modi |
Sarah Byrne | Evelyn Ruiz |
New function added
Restaurant recommendation:
Temporis
Sushiito
El Milagro
��
7
Breakout Group
Group Member Names:
Use your color for your contributions.
Steven Canfield | Rachel Lee |
Paola Marquina | Josie Williams-Baldwin |
A new key idea is the loop command.�
Restaurant recommendation: Any place with good pasta ,�A restaurant which serves blowfish�
8
Breakout Group
Group Member Names:
Use your color for your contributions.
Dean Bartodziej | Audrey Anonuevo |
Tarun Balanagraj | Ray Dharmawan |
Restaurant recommendation: Portillos��
9
Breakout Group
Group Member Names:
Use your color for your contributions.
Hank Thomas | Justin Zhao |
Andrew Romo | Ali Motlagh |
What else can event.key be used to accomplish?�
The ball doesn’t stop unless you press the opposite direction that it is moving for an equal value��
Restaurant recommendation:�T-BELL�
10
Breakout Group
Group Member Names:
Use your color for your contributions.
Brian Chang | Brajan Hendzel |
Kaitlin Keller | Albert arias |
timedLoop: allows for the ball to continuously move?�
Restaurant recommendation: Any good Italian restaurant��
11
Breakout Group
Group Member Names:
Use your color for your contributions.
Nubia Denekew | Vidhi Soni |
Name 2 | Lamiah Gholar |
Increased speed in the movement
Restaurant recommendation: Yuzu Sushi��
12
Breakout Group
Group Member Names:
Use your color for your contributions.
Josiah Shin | Lieth Dallal |
Shaofeng Chen | Daniel Cheung |
The arrow keys control what direction the ball is going, and 1 is the magnitude of change as delta=1.�I wonder what would happen if the sprite reaches the edges of the screen.
Can you make it move diagonally if you press left and up, left and down, right up and up, and right and down. ��
Restaurant recommendation:Rciobene’s, they have a really good beef sandwich.��
13
Breakout Group
Group Member Names:
Use your color for your contributions.
Jared Yang | Jaeleen Montanez |
Diana Guachichulca | Selina Reyna |
Ball moves according to the key that is pressed on the keyboard
Doesn’t have any wall boundaries�Variables, (event.key==”Right”), moves the keys in negatives and positives
https://studio.code.org/projects/applab/alil99u_wMzk7fal1I-TF9vH-Frn47wgViDVbYKDsSg ��
Restaurant recommendation:
Bonchon - chinatown/ division, glenview
Strings Ramen- Hyde Park�Coffeehaus: Boba Tea
Essay Prompt
If you prefer (or if you need to), rather than participate in the class interaction and discussion live online you may watch the class recording and write a 400+ word (3/4 of a page) essay reflecting on the class recording, in response to a prompt that will be posted at the end of the class notes/recording for the day. This must be done within 24 hours of the original class.
Take today’s quiz at: https://forms.gle/9nEPA919Hwg71dhS8
Instructions: