Last night was intense.. I've added the Ice level, it looks quite nice.
I've also registered URLs for Crashblock
http://www.crashblock.com
and
http://www.crashblock.co.uk
I ran into a major hurdle last night whilst trying to implement a seemingly small change.. I've got an idea of how to fix it (better OO design for a start ) but my attempts last night caused horrors.
Basically, I've got a class called TCrashBlockGame which is derived from TCBCGame, all sprites have a link to a TCBCGame object which is passed to the sprite via the constructor. Sprites need a link to the game object so they can play sounds, music, load resources etc..
The uses clause is set up in such a way that CrashBlockGame.pas references CrashBlockSprites.pas but I need it to be the other way around too (annoying circular reference issue). The player's score is contained within CrashblockGame, I want the sprite to be able to check the score and throw out a bonus object if it's after a particular score milestone.
I thought I'd implement a callback last night to sort this out, the sprite in question would ask the game for the score via an event, the game would pass the score back to the sprite via a By Reference parameter. That's when the horror started. As soon as the sprite called the event, my player object (which was untouched by this) started to really misbehave.. this suggests to me that I'm doing something very very wrong indeed. It also completely buggered up the tetris matrix object.
I've removed those changes and the problem has gone away, I don't want a bug like that making it to the final stage.. So I'm going to implement another solution. I'll make the score an object and I'll pass it to the sprite which needs it (just the TetrisMatrix sprite needs it)
Anyway, I was really stressed out about this last night. hence me sinking a few cans of Stella...
The good news is that I've fixed numerous issues with the GUI, positioning and so on and a couple of gameplay issues. I've also added more fruit. Everyone needs more fruit, so instead of just cherrys, we have apples and bananas too.
I've also created diamonds. When you get multiple lines in one go, you'll get a diamond thrown up.
2 rows = 1 diamond
3 rows = 3 diamonds
4 rows = 7 diamonds
(*I've not decided on the actual values yet)
It's really hard to keep on getting 4 rows, so I don't think this will unbalance the game and will be a nice incentive to get people to play a more risky game instead of just 1 line at a time.
Does anyone have any ideas why implementing a call back like that (something I've done many times before without incident) would cause a problem?
Bookmarks