CSCS1320 C/C++ Programming
PROJECT: FUN WITH GAMES (fwg2)
OBJECTIVE
Using your Vircon32 build and installation from fwg0, and pong foundation from fwg1, implement your own breakout-like game: at least one paddle, at least one ball. Ball rebounds off the walls, reflects off the paddle. An array of bricks displayed on the screen, which vanish once colliding with the ball. Score based on bricks hit.
PROGRAM
You are to write a Vircon32 C breakout game: display the usual assets, with the expected mechanics and interactions (paddle, ball, bricks, collision, score).
- a paddle, guarding one of the walls
- paddle moves based on control of the gamepad
- ball moves independently around the screen, rebounding/reflecting
- ball rebounds off non-paddle walls
- ball reflects off brick when a ball-brick collision occurs
- brick disappears upon collision with ball
- ball reflects off paddle when a ball-paddle collision occurs
- scoring based on brick collisions
- use an array to manage the bricks
- use a loop to transact the array
NOTE: the first gamepad by default is mapped to the keyboard
CARTRIDGE BUILD PROCESS
All of these steps can be automated with the use of the provided
Makefile simply by typing make at the prompt.
NOTE that with certain modifications, you'll first need to modify the XML file as appropriate.
COMPILE
First step is to compile the C code, which can be done with the following
command from the Vircon32 developer tools C compiler (compile):
yoursystem:~/src/SEMESTER/cprog/fwg2$ compile fwg2.c -o fwg2.asm
This compiles, or translates, the C code into Vircon32 assembly language code, which will then need to be assembled to machine code:
ASSEMBLE
Once you've compiled your code successfully, you can use the Vircon32
assemble DevTool to assemble the assembly:
yoursystem:~/src/SEMESTER/cprog/fwg2$ assemble fwg2.asm -o fwg2.vbin
IMAGE CONVERSTION
Any PNG images you'd like to use need to be converted to Vircon32 texture
format via the png2vircon tool:
yoursystem:~/src/SEMESTER/cprog/fwg2$ png2vircon background.png -o background.vtex
yoursystem:~/src/SEMESTER/cprog/fwg2$ png2vircon sprites.png -o sprites.vtex
Note that you'll also want to ensure the XML file has been updated to reference these textures:
<binary path="fwg2.vbin" />
<textures>
<texture path="background.vtex" />
<texture path="sprites.vtex" />
</textures>
AUDIO CONVERSION
Should you have any WAV files you'd like to use need to be converted to
the Vircon3 sound format via the wav2vircon tool:
yoursystem:~/src/SEMESTER/cprog/fwg2$ wav2vircon backgroundmusic.wav -o backgroundmusic.vsnd
yoursystem:~/src/SEMESTER/cprog/fwg2$ wav2vircon soundfx.wav -o soundfx.vsnd
Note that you'll also want to ensure the XML file has been updated to reference these sounds:
<sounds>
<sound path="backgroundmusic.vsnd" />
<sound path="soundfx.vsnd" />
</sounds>
PACKING THE ROM
Once all the components have been built, you can pack them together into
a Vircon32 cartridge for use in the emulator via the packrom tool:
yoursystem:~/src/SEMESTER/cprog/fwg2$ packrom fwg2.xml
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
- Any "to be implemented" comments MUST be removed
- No global variables (without instructor approval), no goto statements, no calling of main()!
- Track/version the source code in your private 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/cprog/fwg2$ make submit
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:
286:fwg2:final tally of results (286/286)
*:fwg2:code modified to meet project specifications [26/26]
*:fwg2:grabit of project data by Sunday prior to duedate [26/26]
*:fwg2:screenshot or video posted to class DISCORD of game running [26/26]
*:fwg2:working collision detection between paddle and ball [26/26]
*:fwg2:working collision between ball and individual bricks [26/26]
*:fwg2:code makes use of an array to manage the bricks [26/26]
*:fwg2:code uses a loop to transact the array [26/26]
*:fwg2:source file, XML file, build script, and cartridge submit [26/26]
*:fwg2:code compiles, cartridge builds with no warning or error [26/26]
*:fwg2:committed project related changes to private semester repo [52/52]
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