Wednesday, March 18, 2009

Added a new Gem type to Platformer kit

As part of the lecture/workshop to add a new Gem class we ran into a few issues which I have solved in this pdf.

Platformer_Changes_AddARed150PointGem.pdf (open this to see code changes on left as compared via WinMerge on the original code base - the level 0.txt file shows the changes in a red box)

1. In Gem.cs - make some attributes public, created sub-class Gem2 and defined a new contructor to override color and points attributes. Also changed points to not be const. Made Level a public type so Gem2 could access it, rather than create a new instance(the bug we ended on).

2. In level.cs - allowed for two letters G and Q to make gems, and added score value.

3. Added the letter Q to designate types of Gem2 in map.

No comments:

Post a Comment