Game A Week 3: Blockshooter

blockshooter_1.jpgBlockshooter is the third game to come out of Kotaku Australia's Game A Week feature. If Game A Week is new to you, I suggest you give Zafehouse and Wizkill a go. Both of these (and Blockshooter) were coded in seven days by your resident Kotaku AU editor (in other words, me).

Blockshooter is a combination of Breakout and Space Invaders. It's your job to pilot a little ship, shooting at coloured blocks that come your way. Shooting multiple blocks of the same colour will award you a point multiplier. Destroying entire segments will drop a "piece", which can be collected and added to your ship. You lose points by getting hit or allowing blocks to slip past you.

That's the nuts and bolts of it. If you'd like to give it a go, hit the jump for a download link and developer's diary.

PS. Yes, this has come out on Monday instead of Friday. I've decided to shift the Game A Week schedule by two days, so I can have the weekend to playtest and debug. Don't worry, I'm sticking with the whole "seven days to code" requirement.Download Blockshooter V1.0.

If you're running Vista, you're ready to go. If you're running Windows XP, or get the error "App failed to initialize properly (0xc0000135)", you will need to download the .NET Framework 2.0.

Blockshooter was by far the most painful game to develop. Not only did I have gameplay issues, but technical ones as well.

In the perfect world of game design, one should be able to come up with a concept and be able to implement it without having to worry if it can actually be programmed. Case in point: I wanted to code a shoot em' up that combined Breakout with Space Invaders, but at the same time, not use graphics.

Impossible, right?

Fortunately, I had a solution - I would use controls in place of sprites. If you're not familiar with the term "control", it simply refers to any element of a Windows "form". This can be a button, picture box, text box, label, etc. All you have to do is set a background colour, manipulate the control's position during runtime and bang - you have graphics... of a kind.

The trouble is, controls aren't really supposed to move during runtime, so I had significant performance issues. Even on a dual-core 1.8GHz PC with 2GB of RAM, early prototypes would slow to a crawl if more than 16 blocks were moving on screen. I had to find a way to either a) optimise the movement of blocks or b) reduce the amount of blocks. In the end, I placed blocks inside group panels, and just moved the panels instead of individual blocks. Of course, this broke the collision detection code, and I had to make a custom control to fix it.

Sadly, Blockshooter became a collection of these "hacks" to make the Windows GDI a gaming platform. As you can see by playing, it all works, but I get a little sick in my stomach when I look at the code.

I'm also not happy with the shipbuilding interface. It could be a lot more user friendly. I'm hoping everyone gets the hang of it, but I'm not expecting them to. I had to rush it, thanks to the technical issues I had with the GDI. I might do a revamp in the next few days, but I'm really keen on my next game, which I'll tell you about soon.

Long story short - don't use controls as sprites. It's messy.

If you'd like the source, just hit me with an email.

Download Blockshooter V1.0.


Comments

    Logan Booker, the hardest working man in blogs.

    Hi Logan,

    Ctrl doesn't seem to fire the weapons for me, can you please do a quick check to make sure this works for you.

    I'm really diggin' this series, Logan. I love your committment. =D

    At first I didn't like it, but if you can upgrade your core within the first two levels you can get over the initial spike in the difficulty curve. My current high score is 499335.

    Three issues I've found so far though.
    1. If the blocks are coming down on the far right and they're close to the bottom it's possible to get pinned and cry (not really) as you watch your score plummet.
    2. There are some blocks spawning off the right side of the map where the player can't shoot them.
    3. Can you make the images save to where the game is run from rather than the root?

    @Sirk: Thanks for the feedback, and I'm glad you stuck with it.

    I'll admit it's probably the weaker of the three games, but I accepted the fact when I started the feature there'd be up and down weeks. I think Blockshooter works best as a proof-of-concept. :)

    And all three of your suggestions are good ones!

    @Vangalorr: Hmm, that's very odd. I've used Ctrl since the start of development and it definitely works! Try pressing the Ctrl on the left side of the keyboard. :P

    Ok I worked out my issue, seems I have to hold ctrl until it fires and not just tap it as I'm used to

    @Vangalorr: Try continuously holding Ctrl down.

    @Logan: If I may be so bold, I have a bunch of other suggestions.
    - Make it so you can use the spacebar to shoot as well as Ctrl. I instinctively go for space whenever the level begins only to realise a split-second later that I need to be holding Ctrl.
    - The gameplay mechanic with the Core pieces is too important IMO to be a completely random drop. On one game I didn't get to upgrade my core by the 4th level and it was nigh on impossible to all the blocks in a wave. Perhaps make it a reward that drops when you've cleared a certain number of waves OR (heresy ahead) give the player one for free after clearing each level.
    - Hold off on finishing the level until the screen is clear. There's nothing more frustrating than just clearing a wave and racing to grab the powerup (triply so if it dropped a Core) only to have the Level Clear box pop up.

    I don't know how hard it would be to get all those working in your game (my fields of expertise are C++ and to an extent C#, go Qantm College) but I think it would make the game more skill-based and less reliant on chance (and make me feel less like an idiot for always hitting space).

    I made it through respectably again. The start was a bit tight without any Core upgrades but the middle levels were quite bountiful. I ended up with a final score of 645395.

    I can't make it fire, Ctrl is not working for me. Vista with SP1.

    @Josh: Try holding Ctrl down for a few seconds. If that doesn't fix it, let me know and I'll take a closer look.

Join the discussion!

Trending Stories Right Now