Programming 3 (Nathan, Semester 1, 2012)

Assignment 2

This is your second assignment for semester 1, 2012.

The assignment consists of a programming task and a number of exercises. Milestones for these need to be submitted before their respective deadlines (you will only get marks for a milestone if you hand in the milestone before its deadline). See below for the milestones and deadlines.

To submit a milestone, you need to commit everything that belongs to the solution into your Subversion repository on dwarf and tag it accordingly (i.e. milestone1 for the first milestone, milestone2 for the second milestone, etc.). All files needed to compile and run the milestones as well as tests and documentation need to be submitted! For more details about compiling and the submission procedure, see assignment1 (just make sure you replace ass1 with ass2)!

Please note that this is an individual assignment! Everything you hand in must be your original work (e.g. you cannot hand in any material created by other students or as group work, or downloaded from the internet)! Please see the assessment and the Course Policies section for more information about handing in your assignment.

Programming Task

The task for this assignment is to create and improve (in stages), an iOS game called ProgJumper. For more details, see the milestones below.

All classes need to be tested and debugged before submission, including unit and integration tests! Include test code in your submission, but make sure that no test code will be active in the final program, only when testing (you can do that, e.g., by creating a separate test target with test methods, using NSAssert(), assert(), as well as #define macros and #ifdef).

The overall program and all classes need to be accompanied by documentation, including a description of the class interface(s), and a test report (the quality of the test report counts towards the marks of the documentation, while the quality of the test code counts towards the marks for your code -- along with the actual program code you have written, of course).

Milestones and Deadlines

Week 6: 3/4 April 2012 (12 marks)

Subversion Repository

Check out the empty Assignment 2 directory

Create an empty working directory for assignment 2 on Mac OS X using, e.g.:

svn checkout \
    svn+ssh://s1234567@dwarf.ict.griffith.edu.au/export/student/s1234567/.p3svn-2012/ass2/trunk \
    a2

This will create an a2 directory that you can create your assignment 2 files in. Don't forget to add each file that belongs to your assignment (e.g. using svn add file), then commit all changes (using svn commit).

Download and Import the Game Framework

Depending on your programming environment of choice, download the initial version of ProgJumper: ProgJumper.tar.bz2

Before playing around with the source code (or compiling), follow these steps:

  1. Unzip the archive (e.g. by double-clicking) -- this should create a ProgJumper folder (if a ProgJumper.tar file is created instead, double-click to extract that one)
  2. Copy the content of the created folder (e.g. ProgJumper) into your checked out assignment working directory (e.g. a2). Make sure you copy all files and directories!
  3. From the command line, go to your assignment working directory, e.g.: cd a2
  4. Add everything to your subversion repository: svn add *
  5. Commit the original source code using svn commit -m "original source"
  6. On dwarf, tag the original source code as start using (on a single line):
    svn copy file://$HOME/.p3svn-2012/ass2/trunk file://$HOME/.p3svn-2012/ass2/tags/start -m "start tag"
  7. Now you are ready to compile the program!

Compile and Run the Original Program

Important: only attempt the following steps after you have successfully created the Subversion infrastructure and imported the source code as described in the previous paragraph!

You then need to compile and run the program (following the steps below) under Mac OS X!

ProgJumper comes with an Xcode file for the Mac. Just type open ProgJumper.xcodeproj to open this in XCode, then click Run to compile the program and run it in the iOS simulator.

Documentation

The core of the first milestone is to demonstrate you understand the program by documenting it. While the source code contains some rudimentary documentation, you need to complete that documentation. In particular, you need to

  • draw a class diagram showing all classes and their properties/methods,
  • document the purpose of the classes defined in the program,
  • document all methods and properties,
  • describe your plans for the subsequent milestones (i.e. an overview of what changes you are planning to make to each class for each milestone, which subclasses you plan to create, an the purpose of these changes),
  • create a test plan, describing how you are planning to test the program and each set of changes you are going to make

Add and commit the documentation to your repository. Submit the milestone containing the original source code and documentation as well as the documentation you have added by creating a milestone1 using svn copy (see assignment 1 and the lecture notes for details, but don't forget to use ass2 (not ass1) for this assignment!

Commit your Changes and Submit using Subversion

Commit all changes to the repository and submit your milestone in the usual way, by tagging it milestone1.

Week 7: 17/18 April 2012 (12 marks)

Turn ProgJumper into a Real Game!

So far, ProgJumper is only a framework for a game. In particular, it lacks scoring and lives. You need to make the following changes to the program:

  • initially, the player has 3 lives (instead of just one)
  • the player uses up a life whenever the player leaves the screen at the bottom or sides
  • when the last life has been lost, the game is over
  • allow for a new game to be started when the game is over
  • points should be scored as the game progresses: every time the player bounces or ascends a platform, points should be scored
  • start of a new level when the player ascends (leaves the screen at the top, this is partially implemented already, but probably needs refining)
  • the current level, score, and number of lives should be displayed at the top

Commit your Changes and Submit using Subversion

Commit all changes to the repository and submit your milestone in the usual way, by tagging it milestone2.

Week 9: 1/2 May 2012 (12 marks)

Add Player Names

Allow the player to enter their name before a game (a GUI element already exists for this on the welcome screen).

High Score and other Statistics

Keep track of the highest and lowest scores achieved and the player who achieved those scores. Display all these as well as the average score after each game on the welcome screen or a separate view controller (e.g. using a table view controller).

Commit your Changes and Submit using Subversion

Commit all changes to the repository and submit your milestone in the usual way, by tagging it milestone3.

Week 10: 8/9 May 2012 (12 marks)

Keep a List of Games

For each player, keep a list (or array) of all the games (s)he played. Each of these lists should be sorted by score, starting with the highest score first. Use standard API classes for the lists and to map a player name to the corresponding list. Display the list corresponding to a player after each game on the welcome screen view or a separate view controller (e.g. in a separate section of the table view if you implemented that in the previous mile stone).

Store Game Results

Write the above lists of games and scores to a file after every game (create the file if it does not exist). When starting the program, read the lists from this file (if the file exists).

Commit your Changes and Submit using Subversion

Commit all changes to the repository and submit your milestone in the usual way, by tagging it milestone4.

Week 11: 15/16 May 2012 (12 marks)

Add New Levels

Create a subclass of PMLevel that allows for different patterns and object types. Add bonus objects that appear every now and then and give the player bonus points (more often) or extra lives (less often) when hit.

Create at least 5 different levels of increasing difficulty by manually designing the layout of these levels and by creating random object patterns and types (ensure that level difficulty keeps increasing, but all levels are still solvable). Use your best judgement to keep the game interesting (or make it more interesting) -- e.g., make sure players don't get frustrated by levels that are boring, too easy, or too difficult!

Implement your own Collection Class

Replace the standard array or list class(es) from the previous milestone (that store the list of games) with your own dynamic array or list class. Your class may not use code or inherit from any other class (other than the root class NSObject)! Design the class so that it requires as little change to your existing code as possible (e.g. avoid copy and paste)!

Commit your Changes and Submit using Subversion

Commit all changes to the repository and submit your milestone in the usual way, by tagging it milestone5. As this is the final milestone, make sure it contains all the changes you made in previous milestones as well as up to date documentation! If you had to make changes (e.g. corrections) to previous milestone code, document those changes!

From dwarf, check that all your milestones are submitted properly by listing the content of your repository, e.g.:

svn list file://$HOME/.p3svn-2012/ass2/tags
svn list file://$HOME/.p3svn-2012/ass2/tags/milestone1
svn list file://$HOME/.p3svn-2012/ass2/tags/milestone2
svn list file://$HOME/.p3svn-2012/ass2/tags/milestone3
svn list file://$HOME/.p3svn-2012/ass2/tags/milestone4
svn list file://$HOME/.p3svn-2012/ass2/tags/milestone5

Make sure you tag your final milestone in time (at the end of your lab) so you can be marked before your next lab and receive feedback.

Bonus Marks

A maximum of 20 bonus marks may be awarded for features that go significantly beyond the requirements of this assignment (e.g. features that make the game more attractive such as visual effects, additional/nicer images, more realistic physics, a C++ or Objective-C++ version, etc.). While these bonus marks cannot take you past the maximum 60 marks (30 %) for the assignment, they can make up for any marks you lost elsewhere in the assignment.

If you want to go for bonus marks, please put documentation of what you did that you think deserves bonus points into a file called bonus.txt

Some Hints

Modifying the GUI
For references to the Graphical User Interface (GUI) classes, please see the UIKit API.

You can use Interface Builder to modify the xib files (MainView.xib, FlipsideView.xib, and MainWindow.xib).

Adding Text Label content
You can add IBOutlet UILabel properties in the game view that are connected to actual widgets through Interface Builder in Xcode.

To change the text in an UILabel, you can change the text property, e.g. livesCounter.text = @"123";

Table Views
See the Table View Data Source and Delegate protocol reference documentation for information on how to populate and maintain table views. There is also a nice Table View tutorial on the web.

See also assignment 1 for more hints!


Last Changed: $Date: Mon Apr 30 10:20:48 2012 +1000 $ by Rene Hexel

Online Help

Latest Announcements

12/06/2012
Last chance to get feedback before the exam tomorrow.
08/06/2012
Apologies, but please re-check your results — there was an error on the earlier page!
04/06/2012
Just a reminder to check your assignment results online!

Back to top