INDIVIDUAL MID-SEMESTER PROJECT
BENCHMARK 3
Requirements: THIS IS A BIG ONE!!! In this benchmark, you will create your game's prototype. This means you will make something that looks and behaves somewhat like your final game. Specifically, you will gather much of your game's necessary artwork, and use it to draw your game world and main character. You will then tie your character's movements to the viewport such that scrolling works properly. You do not yet have to implement collision detection, however.
Part 1: Gather your artwork - Draw and find (dare I say borrow?) all artwork necessary to draw your game world and your main character. You are strongly advised to pick up a digital camera and photograph various surfaces to use as background tiles. You are more than welcome to use completely original artwork to make a game that is truly your own, but Internet sources are fine for this assignment. You may use large or small (tiles) artwork, whichever fits in with your game design better.
Part 2: Load all level data from CSV files - In the WorldRenderingGame example that we examined in lecture, I created a simple level with a tiled background and an animated main character who simply stands still. I did this inside the GameDataLoader class' loadLevelExample method, which I called from the loadWorld method. Instead of hard coding a level, you should put all level data inside a series of CSV files, and then load them into your objects. The format you choose to use is up to you.
For example, you may choose to have an initial csv file that points to other files for data concerning a particular layer or sprite type. Or you may choose to put all your sprite data in a single file, etc.
As for actually reading text from a file, you may use an ifstream for ASCII, or wifstream for wide characters like so:
#include <iostream>
#include <fstream>
using namespace std;
...
wifstream inputFile("FileToRead.txt");
if(inputFile)
{
wchar_t inputLine[255];
while(inputFile)
{
inputFile.getline(inputLine, 255);
// NOW DO SOMETHING WITH THE
// inputLine, WHICH HAS BEEN
// FILLED WITH A LINE OF TEXT
}
inputFile.close();
}
Part 3: Render your World - Add code to your program such that when someone starts a new game your game world is drawn according to the following:
- Game World Expectations - your side scroller game world only needs to have one good level and does not have to be enormous, but should have some depth of play. It may be laid out linearly (i.e., left to right), or in multiple directions as needed by the specific game design. The point is that it should play well.
- Scrolling must be smooth - when scrolling through the board, the display must scroll smoothly, no jitter as it goes.
- Prevent scrolling outside game world - don't allow the viewport to scroll out into black nothingness. The viewport should only be able to see the game board. When a border is reached, it should not be permitted to scroll in that direction any further.
Part 4 - Add your Main Character - Add code to your program such that your main character is drawn and animated properly as it moves about the level. A tricky part will be that you must tie key presses to character movement, and thus viewport scrolling
NOTE: You are permitted to use any source code from our textbook or examples we looked at in class. Please understand that students may not share code among each other. This is an issue that I take very seriously. This is an individual project, and so students must do their coding individually. I want to make sure that each student learns to code games in this course, and the only way to do this is to verify that everyone is doing their own work. Incidents of academic dishonesty will be taken very seriously, so please, don't be tempted this late in your academic career.
SUBMITTING YOUR HW: This should be done in two stages:
- Generate an .EXE file, then ZIP it with whatever resources it needs to run (i.e. images) and post it on your project Web page. Do not post your source code there. The TA or anyone else should be able to simply download and play your game without any hassles (setup, bugs, crashes, etc.).
- Hand-in your full Visual Studio project with all source code and other components necessary to build and run your game by zipping it up into a single ZIP file and posting it to the class' Digital Dropbox on Blackboard. Call your submission "X Y's Benchmark 2", where "X Y" is your name. You'll use a similar style for future Benchmarks
A LOOK AHEAD
For the next benchmark students will add animated sprites and collision detection.
Web page created and maintained
by Richard McKenna