Martin Adamek

Independent Android Developer

Taking Android Snapshots From Command Line

If you make snapshots of your Android device’s screen sometimes, you might like following monkeyrunner script. It supports both the default ddms naming and also custom name that you can provide as parameter.

Finally you can wrap the monkeyrunner execution into shell script:

I am neither shell nor python guru, so if you can enhance it, let me know. For example, I am pretty sure one can manage to have everything in one single shell script but that would take too much time to me to find.

Ant With Colors in OS X Terminal

I have decided to try TextMate + Terminal + Ant combo for Android development. I am trying this to keep my Macbook Pro (and my complaining lovely wife) quiet while coding in front of TV. So this is post mainly for the future reference. Add following lines to .profile:

Reference: Mac OS X Terminal Colors Ant Colors

Game Dev Diary: Defining World

Since the latest update I had very few moments to work on the game. I made some refactorings to move away from prototype stage, but I spent quite some time thinking about how the game should look. I was thinking about the design, whether it should contain different visual styles for diferent levels, or what exactly is the single game level. So far I am planning 3 styles of game:

  • Words per minute (or characters per minute) record breaking
  • arcade mode with some bombs and few more surprises
  • multiplayer where you will write words for your opponent and shooting his words at the same time

It is not all well defined yet and I will have to keep it simple from beginning, because I really want to make the release one day, not just add features forever. I welcome all ideas and suggestions you may have.

I started to do some experiments with the look of the world and I came to the world of planes. I was thinking about objects that would allow naturally to paint words on them and plane’s wings seems like a good place. For shorter words I may use some balloons and smaller planes. I have already wowking nice parallax scrolling with earth and planes. I will add clouds below and above the planes too.

Of course, this looks ugly. Both planes and background are just dummy placeholders, but scrolling feels really good. For the beginning I used static bitmap with some circles, but today I was researching procedural generation of the landscape and clouds for more realistic environment. I have something working already, but this will require quite a lot of time. My hope is to have really good looking world there.

Game Dev Diary: Competition and First Screenshot

In last few days I focused on abstraction of the game world codebase. I wanted to provide alternative game mode where cannon will not move under the flying target, but will always stand in the center and shoot from there. The point is that I would like to provide few alternative worlds that have not just different skin for the background and all the objects, but also movement method, targeting etc. That is done in some simple way, but more work will be done on this as requirements will change over time.

So there is nothing unexpected on the code level, but I experienced major WTF moment today on marketing side of the thing. Having a cup of coffee with my Android dev friend Jozef today, he asked me whether there is really no competition on the Market. I said there is not, because I did some searches in the past and I have never found anything. So he took his phone, searched for about 10 seconds and presented me with at least 3 direct competitors. I considered myself experienced searcher, but that is not the case anymore. I searched for ‘type to shoot’, ‘word shooter’ etc and he simply used ‘typing game’. Shit, what can I say. I am not worried about the competition that much, because I believe in execution rather than in original idea, but this kept me thinking what’s wrong with me, for a while.

So here is the first screenshot of the game, now that it is not secret anymore (did I just say I didn’t believe in original idea?):

As you can see, this is shooter where targets are words and shooting is performed by writing those words on the keyboard, one letter at a time. This is of course only graphics-free dev version (though I am considering also retro-look levels). Looking at the competitors, there is nothing close to what I want to achieve at the end, so let’s keep coding!

Game Dev Diary: Projections, Collisions and Tools

It is really hard to get back to the project that was paused just for a few weeks. I was busy with new major update of Apndroid so my game came out of my mind after I finished the prototype that I mentioned in my last post. I did almost nothing yesterday, basically just refreshing the codebase in my head, thinking what’s next.

Productivity

Today I have spent few hours coding and I am leaving off my computer exactly at the time when I was most excited to continue. This is one little advice from Woody Allen that I realized I was doing often. Together with the tip to work only for three to five hours, but every day, it sounds like a good idea. If you are interested in more tips, read the rest at TechCruch.

Projections

First problem I had to solve was the screen size and the projection. The game will run on many devices with different screen resolutions and aspect ratios. I never liked the idea of stretching content so I had decided that I will use all the screen size offered to me and world system units will be mapped 1:1 to screen pixels. That means that OrthographicCamera will cover the whole world with its viewport. There is one more reason for that - every shootable target in the game will have attached text to it and I have found that resized or stretched texts don’t look good. With pixel perfect projection it looks and moves nicely. To keep the same experience to players on all the different screens I will adjust the speed of targets, so they get to the shooter in the same amount of time.

Collisions

While I was adjusting the speed of shots, some of them simply didn’t destroy the target when the speed was higher. The problem was obvious - I was using bounding rectangle based collision detection and from certain speed the shot simply overshoot the target. One frame ot was before the target and on the next frame it was after. I fixed that quickly by simply comparing the distances from cannon to target and cannon to shot. This is quick dirty fix and I have to read more about how this should be solved properly, whether I should use box2d or something similar or whether it is overkill for this kind of game. There are so many areas of the game development I know nothing about, that it is quite scary sometimes. Throw your ideas on me!

Tools

I want to go quickly through the tools I used so far:

  • IntelliJ IDEA free Java/Android IDE that is fast and smart. You will never look back at the Eclipse.
  • Adobe Fireworks €299(ex VAT) graphics editor for bitmap and vector work that I use for all my work, from icons to promo graphics and now also game objects
  • Glyph Designer $29.99 font designer for Mac that just works
  • libGDX TexturePacker free texture packer that you can integrate to your project, set the source folder with bitmaps and it will produce the sprite sheet