Time for another short update on Sparrow. In this post I will briefly write about what I was working on in the last two weeks, and I’ll show you one of the four player aircraft that will be available in the first version.


As I noted in my last post, I started working on the levels two weeks ago. I am almost done with the fourth level, and I must say I am still not bored from testing and tweaking all those enemy waves. Compared to Aqua Guard, I’m having much more fun creating the levels for Sparrow.

The best part in creating the levels is definitely the boss battles (yes there will be several bosses to blow up!). I was having trouble killing the third boss, but luckily I gave it to a mate, Aleksandar (he worked with me on Aqua Guard, you can check his blog here) who killed it without losing a single life. This proved two things: I suck at my own game 😦 , and I must give early test versions to other people before I come up with any conclusions.

I kinda shot myself in the foot when I was asked in a TV interview (during the crazy local media coverage) about how many levels we planned for the first version. Even though we hadn’t decided yet, I said 10 levels, so now we (read that as I) must create at least 10 levels.

Background Tiles

In the first week of February my brother was working on several enemy aircraft and bosses. I believe we ended up with some nice sprites even though this is the first time he is doing pixelart. Few days ago he started drawing some background tiles, and I like where things are going. I will post a screenshot soon; maybe next week.

In the WOWZAPP build, we were using a full texture for the background which used a lot of resources and you could notice slight FPS drops at times. So now, I had to write some code for tile drawing. First I browsed  the net for open-source level editors where we could quickly use the tiles Alpay created to create backgrounds for the levels. We are now using Tiled which has everything that I needed. It saves the levels in a nice XML file which can easily be parsed.

Alpay is drawing 16×16 tiles and because WP7 has a resolution of 480×800, that means 1500 tiles are drawn on screen at any given time. At first I was stuck with updating the positions of 9000 tiles (6 full screens) which was an OK number and not causing FPS drops. If I increased the number of tiles, I encountered drops in FPS. Then I came up with a simple solution of first loading all the tiles during a loading screen to an array, and then using another array of 1530 tiles (one full screen and one row of 30 tiles just above the top) which was used for drawing the tiles. Now, I only have to update 1530 tiles and check the position of the last row. If the last row is out of the screen I extract the next row from the big array that contains the whole level. Now, I can load a lot of tiles (tested loading 72000, worked without any FPS drops) without the need of updating the ones that are off screen.

Collision Detection

I first decided to go with per-pixel collision on Sparrow, but as soon as I reached Level 3 where I increased the number of objects on screen, I encountered FPS drops. I tried optimizing it by checking every other pixel, but no luck. I narrowed the issue down to a certain Texture2D method, GetData(). Apparently the FPS drops happened when I was extracting the color values from the textures. I was even using collision rectangles (extract only the area covered by the rectangle where the intersection between two sprites happens) rather than extracting the colors of the complete textures.

I was definitely not going to decrease the number of objects on screen, so I decided to return to rectangle collision, but a little more sophisticated one. Now I am using Rectangle arrays for each object that contain several rectangles to cover the objects. For example, I can cover the Su-27’s area with only 3 Rectangles. The performance drastically increased and I can’t notice any visual problems with the collisions.

Are we going to miss another deadline?

Hopefully, we aren’t. There are two more weeks until February ends, and we should have at least 8 levels until then. The menu screens might not be all ready by then, but temporary stuff shouldn’t be a problem when giving the game to several people for testing. If you have a Windows Phone and are interested in testing the game before it is released, let me know.

Rahim is currently working on implementing Scoreoid for achievements and score tracking. In the last two weeks he was also working on save states and menu screens for choosing aircraft, levels and weapons.

The Screenshots

This is a Su-27 Flanker which is a playable aircraft.

OK, I know I said I will only show one aircraft, but I really like how the Su-25 Frogfoot looks, so I must show you that one too. The Su-25 will be an enemy plane.

Thanks for reading!