class: title # Using SDL2 ## CSC 161 – April 21, 2026 --- # Agenda for Today 1. Department Events 1. Upcoming Work 1. SDL 1. "Lab" Time --- # Department Events ## CS Table: Fault-Tolerant Computing .indent[ Tuesday, April 21st at noon in JRC 224C ] ## CS Picnic .indent[ Friday, May 1st at 5pm in the Merrill Park West shelter RSVP by this Friday:
] --- class: section blue # Upcoming Work --- # Homework: Pathfinding **Due:** Thursday, April 23rd by 10pm ## Q&A **Aren't `movelist_clear` and `movelist_destroy` the same thing?** They might be implemented the same way, but they mean something different at the interface level. Removing all items from a list is conceptually different from freeing all the memory used to store a list. **Do we need to use `movelist_t` in the `plan_route` function?** Yes, but not as the queue for breadth-first search. The breadth-first search will use a queue of coordinates. You will eventually need to add moves to the `movelist_t` when you find a path. --- class: section green # SDL --- # SDL Challenges We'll use the rest of the class today to practice using SDL2. ## SDL Challenges - Add lines to the soccer field in the demo. - Add goals to the soccer ball demo. Detect when the ball passes through a goal and return it to the center of the field. - Add a player (or multiple players) that you move around with arrow keys. The player kicks the ball when they get close to it. Choose one or two of these extra challenges, or come up with something on your own. --- # Wrap Up ## Lab Report When you submit the lab report for this week (due next Tuesday), just include whatever you've built with SDL2 during class time today. If you missed class, spend at least an hour on one of the suggested challenges and submit whatever you produce in that time. ## Reading Read about the final project before class on Thursday.