User Tools

Site Tools


notes:cprog:spring2025:projects:mtb1

This is an old revision of the document!


MTB1

NOTE: this is a collaborative document between a couple of my classes this semester. That means more people editing. Be mindful that only one person can edit the document at a time.

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

Pong Basics

Paddle

The Paddle should function identically to the moving box from mtb0, except restricted to only moving in one dimension (up + down, or left + right)

Ball

Paddle movement

Ball movement

You can move the ball by updating it's position every frame of the main while loop of the program. By creating variables for the balls position, speed, and xy vectors we can control the balls velocity. By using speed and vector variables to calculate the x and y position we can make the ball bounce off of walls by negating the vector values.

Bounds deflection for ball

Collision detection: ball and paddle

notes/cprog/spring2025/projects/mtb1.1739770786.txt.gz · Last modified: 2025/02/17 05:39 by bdildine