SM2603 2D Game Production Assignment 2 (worth 20% of the course)
This coding/programming assignment is related to the material in some of the labs, so it would be helpful if you look at those if you have not already. This is to be done individually and submitted individually.
Your task is to create some of the simple parts of a Mario-like platformer game. However, besides using the given sprite file (¡°sprites_mario.png¡±), your environment does not have to be related to the Mario game, as long as there is a similar type of ground for the character to move on. Note that of course we do not have the copyright for the Mario characters, graphics, music, etc…, but we are using them for our educational purposes here.
You are suggested to start with the cpp file from week 9 (week09b_character_jump.cpp) on Canvas. You must use SDL and its overall code structure that we looked at in class. But if you wish, you can start from the scratch and write the code yourself. However, you should (and may as well) use similar logic and similar code as in the week 9 cpp file. Either C or C++ is fine. (C++ as in with classes, but ECS is not needed.) You can use math libraries, but they are not really needed, as there is really nothing complex that you would need (except maybe for the physics of the character which you have been given in the week 9 code). Implement the following features:
(i) Draw the character (you must use the given sprite file called ¡°sprites_mario.png¡±). Make the character move and walk horizontally when the player presses the left and right keys. Draw an environment for it to move on. You can find and choose the environment yourself. Note that the given image sprites file has the mario character running too, rather than just standing still as we saw in the lecture.
(ii) Make the character jump with a user key. Note that when it¡¯s jumping, the image changes to the last one in the sprite file. You get more marks if you can simulate the physics of the jumping as closely as possible (i.e. to make the jumping motion look smooth) even as the character jumps onto platforms. The character should be able to jump onto some platforms higher than the ground. You will need to find some environment images yourself, draw them on the screen, and do collision detection with them.
(iii) Make the character jump up and hit some brick, which then displays a coin on top of it for a short time, to show that a coin has been collected. We saw an example from the Mario game on youtube in class (but that was just an example, and you do not have to follow it exactly). You get partial marks even if you just implement some type of jumping up and detecting that a brick has been hit. And then you get more marks: for the small upwards motion of the brick when it is hit,
for showing the coin and its quick motion at the top, and for the ¡°brick with question mark¡± switching to one that cannot be hit afterwards.
(iv) Play some background music. And play some sound when a brick gets hit. You can find some audio files yourself, but be careful not to take copyrighted music (again these do not have to be related to the Mario theme as long as there is some music/sound).
(v) Choose your own feature and implement it. You get more marks if it is more complex. You also get more marks for creativity. So it does not have to be an existing feature in the Mario game, although it can be.
Grading
20% for each feature above. For each feature, you can get partial marks if it is not completely implemented. So don¡¯t skip any feature completely, and at least try to show something, and add some comments in your code to explain what you did and label it with the feature number above clearly. You also get marks for being more artistic/creative. So if you make it look nice visually, that is better. If you make it a bit different from the Mario game, but still make it fit within the game as a whole, that is okay too.
Submission on Canvas
Submit your files to the ¡°Assignment 2¡± submission page. Submit your cpp file(s), exe file, and all image and audio files that you used. Make sure that your cpp file can compile and run without modification, when the appropriate image/audio files are placed in the right folder.
Also, capture a short video of your game being played by you, and showing all the important features of your game, and submit the video file (e.g. mov, or mp4) too.
It will be easier if you put all your files into a zip file and then submit the zip file.
No written report is needed. But if one or more of your features does not work or only partially works, you should put comments in the cpp file(s) and at least explain what you tried to do, so you may get partial marks.
Be careful to not use explicitly copyrighted material.
Be careful with plagiarism of other people¡¯s code.
Deadline is Friday, 13 November, at 5pm. 10% late deduction per day.