User Tools

Site Tools


notes:cprog:spring2025:projects:mtb3

This is an old revision of the document!


MTB3

Only task headings have been provided. You are not expected to know how to do the task given by just that description (although in some cases it can be adequately figured out). Instead, if no further information is yet present, ASK FOR DETAILS on the discord, then contribute that clarity here.

If something is present but needs polish: spruce it up.

If something is present but is incorrect: please fix it.

This is intended to be an informative, useful document that all can benefit from.

Those with prior experience, please be mindful not to gobble up all the low-hanging fruit from the newcomers.

URLs

Breakout

Game where you have a set of bricks that are breakable by the ball. You also have a paddle to bounce the ball towards the bricks. If the ball falls under the paddle, end game or lose lives.

brick field

brick structure

array of bricks

brick ball collision detection

There are many ways to check for collisions. First, an object that needs to be collided with has to have a hitbox. This means there needs to be a variable representation of an object's dimensions with an x variable and y variable. Since many parts of this game will have a hitbox, It might be smart to make a struct. A struct is a user defined data type that groups together variables; good for organization and helps with parameters with functions. You can make a struct containing x and y variables. This will make it so you don't have to individually make variables anymore, and can group them into one object through encapsulation. Though when using structs, if you want to pass them as parameters, you would have to learn about pointers.


pointers

notes/cprog/spring2025/projects/mtb3.1741146062.txt.gz · Last modified: 2025/03/05 03:41 by tstrickl