CS 3 (Spring 2024) Project 03: Scene (Game)

In this project, you will implement mouse click detection to your game.

Code Correctness

Game

This week, you will be implementing mouse clicking detection, allows the user to interact with the game by clicking the screen.

Since the SDL feature this week is keyboard events for the pacman demo, by additionally incorporating mouse click detection, users will be able to interact with your game using the mouse and the keys.

Mouse Clicking

Now, it’s time to implement mouse clicking! You will be using mouse clicking to click through different CS 3 related memes. We have give you TrueType (.ttf) files for fonts and images for the memes in the assets folder. You will be writing code so that when you compile your C program, the following sequence occurs:

We expect your meme generator to have at least the following

Here are a few hints and starting questions for how to approach your meme generator

As always, feel free to play around with different fonts and images. You are welcome to make more memes, but make sure you have the ones shown above.

For some help, take a look at the official SDL documentation, SDL documentation on mouse, or some resources here! Also keep in mind that SDL_GetError() may come in handy when debugging your code (more information in the previous link). Additionally, you are allowed to use google (responsibly!) as resource to understand the documentation.

Note that you should not be re-implementing image rendering code or text displaying code; one of your teammates should have implemented that last week. Thus, you should copy over your team’s image and text methods from sdl_wrapper.c/sdl_wrapper.h and use game.c from last week as a foundation for your game this week.

As a reminder, to run the game, all you need to type is make game.