User Tools

Site Tools


Sidebar

projects

wcp1 (due 20250129)
abc0 (due 20250205)
btt0 (due 20250205)
pct0 (bonus; due 20250205)
pct1 (bonus; due 20250205)
pct2 (due 20250205)
wcp2 (due 20250205)
mtb0 (due 20250212)
pct3 (bonus; due 20250212)
wcp3 (due 20250212)
mtb1 (due 20250219)
pct4 (due 20250219)
wcp4 (due 20250219)
mtb2 (due 20250226)
pct5 (bonus; due 20250226)
wcp5 (due 20250226)
gfo0 (due 20250305)
mtb3 (due 20250305)
pct6 (due 20250305)
wcp6 (due 20250305)
mtb4 (due 20250312)
pct7 (bonus; due 20250312)
wcp7 (due 20250312)
bwp1 (bonus; due 20250326)
mag0 (due 20250326)
pct8 (due 20250326)
wcp8 (due 20250326)
mag1 (due 20250402)
pct9 (bonus; due 20250402)
wcp9 (due 20250402)
haas:spring2025:cprog:projects:mtb1

Corning Community College

CSCS1320 C/C++ Programming

PROJECT: Move The Block (MTB1)

OBJECTIVE

Building off of your MTB0 progress, start to lay out the infrastructure and logic for a simple paddle, ball pong game.

Custom graphics for paddle and ball.

Ability to control the paddle.

Beginnings of bounds checking for paddle and ball (should not be able to leave the screen).

EDIT

You will want to go here to edit and fill in the various sections 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

The ball needs to have collisions with both the walls and the paddle. The ball also needs to be constantly moving, with the ability to switch to opposite directions whenever it hits the wall or the paddle. This can be done through two variable possibly called ballXDirection and ballYDirection wherin both values can possibly be either -1 or 1. If ballXDirection is -1, then anytime the ball is being moved by some amount in the x direction, multiply it by the ballXDirection, to reverse it if it negative, or to keep it the same if it is positive. This means any time a ball has the ballXDirection being negative, it will make the ball move left. if the ballXDirection is positive, the ball will move right.

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

Create variable that represent the hitbox for the paddle. One could possibly make a yhitbox offset that represents the distance from the center of the paddle to it's extreme in one of the y direction. To represent the other direction just negate it. The same can be done for the x direction.

 

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

  • Project must be submit on time, by the deadline.
    • Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
  • Executed programs must display in a manner similar to provided output
    • output formatted, where applicable, must match that of project requirements
  • Processing must be correct based on input given and output requested
  • Output, if applicable, must be correct based on values input
  • Code must be nicely and consistently indented
  • Code must be consistently written, to strive for readability from having a consistent style throughout
  • Code must be commented
    • Any “to be implemented” comments MUST be removed
      • these “to be implemented” comments, if still present at evaluation time, will result in points being deducted.
      • Sufficient comments explaining the point of provided logic MUST be present
  • No global variables (without instructor approval), no goto statements, no calling of main()!
  • Track/version the source code in your lab46 semester repository
  • Submit a copy of your source code to me using the submit tool by the deadline.

Submit Tool Usage

Let's say you have completed work on the project, and are ready to submit, you would do the following:

lab46:~/src/SEMESTER/DESIG/PROJECT$ submit DESIG PROJECT file1 file2 file3 ... fileN

You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.

RUBRIC

I'll be evaluating the project based on the following criteria:

104:mtb1:final tally of results (104/104)
*:mtb1:submitted Vircon32 cartridge [13/13]
*:mtb1:submitted C code XML and build script [13/13]
*:mtb1:ball rebounds around the screen [13/13]
*:mtb1:paddle moves in its domain, limited by screen [13/13]
*:mtb1:cartridge is NOT added to repository [13/13]
*:mtb1:bounds checking for paddle and ball [13/13]
*:mtb1:initial collision detection for ball and paddle [13/13]
*:mtb1:committed project related changes to semester repo [13/13]

Pertaining to the collaborative authoring of project documentation

  • each class member is to participate in the contribution of relevant information and formatting of the documentation
    • minimal member contributions consist of:
      • near the class average edits (a value of at least four productive edits)
      • near the average class content change average (a value of at least 1024 bytes (absolute value of data content change))
      • no zero-sum commits (adding in one commit then later removing in its entirety for the sake of satisfying edit requirements)
    • adding and formatting data in an organized fashion, aiming to create an informative and readable document that anyone in the class can reference
    • content contributions will be factored into a documentation coefficient, a value multiplied against your actual project submission to influence the end result:
      • no contributions, co-efficient is 0.50
      • less than minimum contributions is 0.75
      • met minimum contribution threshold is 1.00

Additionally

  • Solutions not abiding by spirit of project will be subject to a 50% overall deduction
  • Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
  • Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction
  • Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction
  • Individuals who have not participated at least 50% will be subject to a 50% overall deduction.
haas/spring2025/cprog/projects/mtb1.txt · Last modified: 2025/02/05 19:17 by 127.0.0.1