Progress

So a couple late nights of coding and I have some progress.  First off, I “fixed” the textures of the coins.  I didn’t put my ugly mug on them but that can come later. For now I have this simple star pattern I took off the interwebs.

Coin collecting ... will it have a purpose in the game. Purchase powerups inbetween levels, perhaps?


I was able to check off a few items on the to do list as well. I was able to finish the Specials reworking to behave more like Widgets in the editor. Specials now are faded unless they can be placed, with some being able to be rotated, and can be larger than 1×1. To prove this is working I made a Prop (static object) of a large “mound” which takes up 2×2 grid squares. Right now it has the texture of stone but really it could be anything.

Unfortunately I didn’t tweak Widgets enough to make some grand unifying design where everything goes through the same code to place/store items on a level. There is now a bit of code duplication, with more to come for Enemies. I was stressing about doing this, because I hate duplicated code, but the way I store the Widgets vs Specials vs Enemies, there wasn’t a nice way to do it in a general sense anyway. I could have called the same functions but put in a big select…case statement everywhere for all three types. Or I could have a large “Entity” data type that stored all the data for any type of item on the map. These are not quite worth it, in my opinion. Especially when I’d be stepping on code that is a few years old. If the language was OOP there would probably be a clearer path, but I just didn’t see it with what I’m using. Maybe I’m getting old. Or lazy.

I must say, like a kid who rediscovers just how good sugary soda is, I find it quite tasty to get quick results with several copy/paste/adjust sessions. I can see why code duplication and minor tweaking is so tempting under a time crunch. I still don’t like it, but I’m willing to live with it.

Comments are closed.