#screenshotsaturday review (2010-11-27)

Here's a review of another #screenshotsaturday! If you don't know what it is, read the first post in the series.

I totally don't know what's going on here - but I'd like to find out! (by @cucumberoneye)

Looks like an old-school massive shoot'em-up. I'd like to play that. And the art style resembles what I'm aimingfor in my next game! (by @AnnalsOfTime)

That's intriguing. A single screenshot - and I'm in the story, I want to know what happened and what will happen next. (by @AlexanderOcias)

A Monaco clone? (by @onebitbeyond)

Awesome explosions here! (by @charliesgames)

That's beautiful. I love the lighting and blurry look in Swapper. Be sure to check its trailer here! (by @facepalmgames)

Yeah, @cardboardcompy made it here again. That art style really gets me.

Tips and hints for beginning game developers

So you want to be a game developer? You're lucky, because that's the post you've been looking for. If you follow the steps below, you will become a true game developer!

Two most important steps are:

1. Actually start writing a game.

2. Finish this game.

Ok, that was too easy. Let me elaborate it a bit.

1. Actually start writing a game.
What kind of game do you want do write? Think about it.

Don't write that game.

Let me put this straight: your first game will always suck. Always. Just like your first drawing sucked, your first bike ride was a fail etc. That's why you don't want to spare your great game idea for that first, lousy shot. Secondly, you can't estimate how big your project is, because you haven't actually written any. And if your project is too big, you won't be able to finish it and won't ever get to point 2.
One more hint: if you want to write an RPG as your first game, you're screwed. It's ten times too big for you. And if you want to write a MMORPG - you're very screwed and you're 14 years old.

Pick something relatively known and (possibly) easy for start. Write a Pong clone, a Pacman clone, a Tetris clone... You'll be surprised how much fun it is and you'll be surprised how much work it is. Really. And by picking a known game you have a very clear goal to achieve - that's very important.

After you finished your Pong, think: what always annoyed you about Pong? Is it too slow? Too boring? Maybe it would be better with some funky bonuses? Write it! Let your creative juices flow and fix (or spice up) the original idea! That's a great exercise in game design.
Guess what - I wanted to write a simple Arkanoid clone as my first Android game.

That's my Arkanoid. Rockin', huh?

I have to tell you that I don't like Arkanoids and I don't play them, ever. I just wanted to practise game development on Android. But with some ideas applied I actually managed to make it fun (for me at least ;))! And so I came up with Kilgamore Castle.
And that's how it looks right now. You've come a long way, baby.

2. Finish this game.

Derek Yu wrote a great post on that subject. You should read it now.

Additional resources

There are tons of blogs, tutorials and other things on the web that might help you. There's my little, distilled list of things that you should read:

  • Everything by Jonathan Blow. You know him, right? You should. He's the author of Braid (just don't tell me you don't know what Braid is...) and (in my opinion) he knows a LOT about game design. His blogs are: number one, number two.
  • Chris DeLeon wrote a helpful post for you. The whole blog is helpful too (albeit a little bit wordy), so you can subscribe to it right away.
  • Wolfire guys. Some thoughts on game design, a little bit of programming and indie marketing.
  • If you're into horror games, this blog is very valuable. Lots of interesting thoughts about horror game design. From the guys of Amnesia and Penumbra.
  • There's also a blog by Chris Pruett. It's focused mainly on the programming side of game development; highly recommended for programmers.
  • Edge Magazine (I mean the printed one). It's good.
  • There are two famous blogs about indie games, very inspirational: IndieGames and TIGSource.
Good luck with your game!

Kilgamore Castle available now!

It's a game written by me exclusively for the Android platform, published by HyperBees. You play as Ernest Pucklington, a retired treasure hunter. He finds a treasure map and decides to take the plunge again! Ernest sets out on a treasure hunt to Kilgamore Castle (shown by the map) together with his dog Barney. They overcome many obstacles and make some amazing discoveries on the way. It's an Arkanoid-type game with unexpected twists, quests to complete and mysteries to solve; integrated with Feint.
Some promo images:

And the QR code:

#screenshotsaturday review (2010-11-20)

Ever heard about that new Twitter thing? Every saturday game developers post a screenshot of what they're working on at the moment and tag it as #screenshotsaturday. Actually, I haven't posted anything this saturday, but I came up with an idea to "review" some of these screenies. My choice is totally subjective! If you agree or don't agree with any of my statements, or just want to extend info about your screen featured here, write a comment!

Ok, let's go!

That's a game by @adamatomic and @chevyray (if I remember correctly). I really like the pixel art here - fairly low resolution, but very well used.

Some weird art here, I wonder what's this game about. Looks like a cross between a board and video game. (by @S0phieH)

I like that art and colors. It's from the game "...But That Was [Yesterday]" by @onemrbean, you can play it here. I strongly recommend giving it a go, it's just about 10 minutes of play. The game's story may be a bit ordinary, but I love the way it's been told, using the language of video games. Unfortunately it's not a common thing, most games are just trying to use the movie language.

Ok, call me an old, nostalgic man, but you have to admit that these 10-pixels elf and kobold are just cute. (+ I like roguelikes) (by @OddballDave)

That reminds me of System Shock 2, which is one of the best games ever created. (by @radiatoryang)

Yeah, yeah, another lovely pixel art. (by @hamumu)

Very interesting art style, something between Grim Fandango and Another World. I'm curious about that game. (by @cardboardcompy)

Makes me want to kick that red guy in the face RIGHT NOW! And who doesn't want to be a ninja? (by @seregrail7)

Looks like an insane battle (it.s for 2 players). Sadly, it's for iPad only... (by @huikea)

It's a screenshot from "Victorian room-based submarine roguelike" and it's one of the reasons I posted it here. (by @JasonP_)

That's it! Would you like me to review another #screenshotsaturday? Well, I did it: here's the next one!

Kilgamore Castle game icon

I'm working on a game for Android platform for a few months and it's shaping up pretty nicely. More details soon, so stay tuned!
That's the (probably) final icon for this game:

No, the game is NOT a clone of Bejeweled or any other match-three-items-in-a-column casual game. It will be an arcade game.

Galcon for Android available now!

Do you know Galcon? It's a strategy game, which lasts up to 5 minutes and requires arcade skills. Or, it's an arcade game that involves a lot of strategy. It is available on any desktop platform, on the iPhone and now - on Android! The best thing in Galcon is the multiplayer! There are some really epic battles (still lasting just a few minutes) and lots of fun. Plus, the multiplayer is multiplatform - so you can kick some iButts if you want. ;) I already bought it and I suggest you to do the same. BUY IT NOW!

I am not related to Phil Hassey (Galcon's author) in any way. It's just an awesome game, that's why I'm recommending it!
If you can't buy Market apps in your country, read this post.

If you can't buy Market apps in your country, read this post.

How to buy apps on Android Market in any country

First things first: I don't understand why the full Android Market is unavailable in most countries. Well, maybe selling apps by developer in country X requires some tax work, but why letting X citizens buy apps is so hard? It sucks ultimately. There's money lying on the street and Google doesn't bother to pick it up.
Anyway, you can fix that for yourself; without rooting your phone, hacking etc. The simplest solution is to buy a SIM card from Market-enabled country. For example you can buy an o2 card from UK or T-Mobile card from Germany. They are available on eBay or your country's counterpart (e.g. Allegro in Poland).
Next step: go to http://checkout.google.com and configure Checkout for your Google account. You must have a bank card that allows internet payments - almost every card does.
Then put newly purchased SIM in your phone, connect via WiFi and enjoy the full Market goodness!

Note: you can buy an app and switch back to your standard SIM card. The app will be still available!

Saving and loading files from SD card

This is especially useful for saving (and loading) your game's state. It uses SD card by default, but it degrades gracefully to internal memory when the SD card is unavailable. "Why should I save game state to SD card?", you might ask. Well, large part of Android users are using custom ROMs on their devices. They upgrade it often and they often have to wipe the internal memory. Nobody wants to lose progress in any game, so storing it SD card seems better to me. Besides, if you switch phones, it's easy to copy or backup your savegames. Digression aside, let's dive into the code!

 1 2 3 4 5 6 7 8 91011121314151617181920212223242526272829
public static boolean saveFile(String fileName, Context context) {
try {
File sdDir = Environment.getExternalStorageDirectory();
String path = sdDir.getAbsolutePath() + "/YOUR_DIR_NAME/";
File sgDir = new File(path);
if (!sgDir.exists()) {
FileWriter fw = new FileWriter(path + fileName);
BufferedWriter out = new BufferedWriter(fw);
String toSave = "I want to be saved in a file!";
return true;
catch (Exception ex) {
try {
FileOutputStream os = context.openFileOutput(fileName, 0);
String toSave = "I want to be saved in a file!";
return true;
catch (Exception ex2) {}
return false;
This is a function for saving. What's going on here? There are two unobvious things:

  • getExternalStorageDirectory() - returns the root SD card directory (it's a method of android.os.Environment). Use this, instead of hardcoding the /sdcard (or any other) path!
  • context.openFileOutput(fileName, 0) - opens a file associated with this Context's application package (in device's internal memory). More info in the docs.
The rest is just standard Java I/O stuff. Function for loading:
 1 2 3 4 5 6 7 8 91011121314151617181920212223
public static String loadFile(String fileName, Context context) {
try {
File sdDir = Environment.getExternalStorageDirectory();
FileInputStream is = new FileInputStream(sdDir.getAbsolutePath() + "/YOUR_DIR_NAME/" + name);
byte[] byteArray = new byte[is.available()];
is.read(byteArray, 0, byteArray.length);
String content = new String(byteArray);
return content;
catch (Exception ex) {
try {
FileInputStream is = context.openFileInput(fileName);
byte[] byteArray = new byte[is.available()];
is.read(byteArray, 0, byteArray.length);
String content = new String(byteArray);
return content;
catch (Exception ex2) {}
return null;
Nothing new here. Checking whether the given file exists:
 1 2 3 4 5 6 7 8 910111213141516
public static boolean fileExists(String fileName, Context context) {
File sdDir = Environment.getExternalStorageDirectory();
File sg = new File(sdDir.getAbsolutePath() + "/YOUR_DIR_NAME/");
if (sg.exists())
return true;
try {
FileInputStream is = context.openFileInput(fileName);
if (is != null)
return true;
catch (Exception ex) {
return false;
return false;

Creating custom, fancy buttons in Android

Ever wondered how to properly create a custom button, which looks different when selected (or clicked) and can be resized? Fortunately it's quite easy in Android. Let's start by creating a bitmap for our button. I'm using Gimp for such things. That's what I got:

(I told you it would be fancy!)
As you can see, I created 4 variants. Accordingly: regular button, pressed button, selected (focused) button and the disabled button. I can create a 4-state button now with such XML:

 1 2 3 4 5 6 7 8 9101112
<?xml version="1.0" encoding="UTF-8"?>
<item android:state_enabled="false"
android:drawable="@drawable/button_menu_disabled" />
<item android:state_enabled="true"
android:state_pressed="true" android:drawable="@drawable/button_menu_pressed" />
<item android:state_enabled="true"
android:state_focused="true" android:drawable="@drawable/button_menu_selected" />
<item android:state_enabled="true"
android:drawable="@drawable/button_menu_normal" />

Put all the files (button_menu_normal.png, button_menu_pressed.png, button_menu_selected.png, button_menu_disabled.png and the newly created button_menu.xml) in your res/drawable directory. That creates a drawable consisting of our three images, each for one state of the button. If I want to use it in a button, I have to specify my drawable as a button background (in some layout XML file):

 1 2 3 4 5 6 7 8 910
<Button android:id="@+id/new_game"
android:text="New game"

Let's run the project! Oh, it doesn't look very nice...

That's because our buttons aren't resizing properly. Android just takes our bitmap and stretches it to fit the button. It's ugly.

Nine-patches, we need you!

Wait, nine-what? Nine-patches (or nine-patch drawables) are the Android's remedy to resizing problem. Basically a nine-patch is an almost-ordinary image, just it's treated by the system differently when resizing. Look at this:

That's a nine-patch image. Two things differ it from a regular image:
  • it has a 1-pixel border with some black pixels
  • it has to be saved with name like my_image.9.png
So what are those black pixels for? They indicate which parts of the image will be stretched. Look:

Android looks at those black pixels and divides the image in 9 parts using them and then resizes the image like that:
  • Parts 1, 3, 7 and 9 aren't resized at all
  • Parts 2 and 8 are resized horizontally
  • Parts 4 and 6 are resized vertically
  • Part 5 is resized horizontally and vertically

So only the pink parts are resized (in one axis) and the most pink part is resized on two axes. (that phrase sounds really weird)

That's how it looks when resized (I left your favourite pink color to show the patches):

Neat! You can create 9-patch images with any image manipulation program, but there's a little tool in the Android SDK for that purpose. Look for it in ANDROID_SDK_DIR/tools/draw9patch.

It's very simple, but it does the job. Play with it for a while or read some instructions here.

Ok, I've changed my button images to nine-patches (so button_menu_normal.png became button_menu_normal.9.png etc.). Let's change the code. The best thing is that we don't have to change anything! If Android sees the button_menu_normal.9.png file, it loads it automatically as a nine-patch image that's available under id @drawable/button_menu_normal. How cool is that?

Running the app gives us nicely resized buttons now.

  • create your button image
  • create some variants for clicked, selected and disabled states
  • make 9-patches of it
  • create my_fancy_button.xml file in res/drawable directory
  • set it as your button background in the layout xml file

Easy! I'll continue to dig this subject and add some styling in the next post.

How to stay motivated whilst programming a game

Cliff Harris (known as Cliffski, author of Gratuitous Space Battles) wrote a really nice blog post about motivation in game programming.

Keep a log of what you did each day

That's very important. It just feels good when you can check off some tasks after every coding session. You will notice your progress, even if the changes can't be noticed from inside the game. So, write to-dos for every little thing that needs to be done! I'm using iDeskapp for that. You can read about its "Tasks" feature here.

you need to sell a full-price game direct to a customer every 45 minutes, or you probably won’t make a career as a full-time indie

I would argue with that. Well, maybe not exactly "argue" - I just want to point out that there are a lot of people who aren't full-time indies and don't have to sell a lot of games. Of course, you probably can't make games in your spare time just for fun in the long run, but I think it's how it begins. You have a job and code something in the evenings - for free. Then it just grows naturally to some sort of commercial activity and the next step is a switch to full-time game developer. But you don't have to sell zillions of copies of your first game.

Anyway, Cliffski's got some really good advices there and I encourage you to read it.

Another post on sales

Did I say something about lack of promos on Android Market? Well, here you go: Glu just started a sale, the following games are available for just 0.99$ each until July 6th.

- Build-A-Lot
- Call of Duty: Modern Warfare 2
- Diner Dash 2
- Family Guy Uncensored
- Stranded: Mysteries of Time
- Super KO Boxing 2
- Tony Hawk VERT
- World Series of Poker - Hold 'Em Legend

Have fun!

Indie games on sale

There are a lot of opportunities to buy some decent indie games for a low price recently. You certainly heard about the Humble Indie Bundle, now there's a Steam sale. I'm pretty vulnerable to all of these. This time, I bought Zeno Clash.

Zeno Clash's price dropped to $3.75. One day after I bought it. Today Osmos is on sale for $2.50, but I didn't bought it and I consider it as a big success of my willpower.
These sales are great, even if they are so tempting. I wish they would do actions like this on Android Market (especially selling games in bundles).

Powered by Blogger