Tuesday, October 11, 2011

Comments on Assignment 1

Overall, the first assignment was quite well done.  There were a few reoccurring issues that I figured I'd point out here so that everyone can avoid these (mostly minor) problems in the future:
  • Be sure to remove all warnings before submitting your assignment.  I did not take marks off for this, but it's very good practice to fix your warnings.  Even though most may be harmless, they can make you not notice more serious warnings.  I have seen even professional developers get into trouble when they let their warnings slide in large projects.
  • Try to organize your code in a nice, object-oriented way.  Don't just add code to the main game class that was provided without thinking about whether that makes sense.  Instead, decide what concepts should be their own objects and how these objects should interact.  This will be especially important for your project since you'll inevitably have more code than on the shorter assignments.
  • A lot of you used int to define things like the colour of your block.  Though this does work, I want to encourage you all to use enumerations in cases like these.  There is some good discussion as to why to favour this approach on this Stack Overflow discussion.  Again, from my own experience, I can say that using enum has proven to be rather useful.
  • Avoid using magic numbers.  A fair number of you used literal numbers to both define the size of your game grid and to loop through its elements.  In one case, these numbers didn't even agree.  You can use a #DEFINE for your numbers, or even better, use const variables.  If you group all your defines together in your header file, you also have a one-stop shop for adjusting values in your game.
  • Be careful with your user interface.  Why leave the window the size used for the demo when you are only using a fraction of it for your game? Even worse is if you don't show the bounds of the actual playing area.  How is the player to know where their blocks can go when there's an invisible wall? In each assignment think about how to help your user better know what's going on.  This and feedback are important elements of game design.
I think that's it for now.  If there was something specific I commented about on your assignment that you'd like to know more about, just send me an email.

No comments:

Post a Comment