Author Archives: admin

Flappy Beard [Day 2] – Gameplay basics and adding the splash screen

Today I’ve decided to do the core functionalities of the game and the actual gameplay.

I’ve started with the infinite background scroll which gives the player the effect that the main character is moving, although it’s always drawn at the same X position on the screen. The simplest way to do this is to have a background that is the same width as the screen width. This way we will draw the background maximum 2 times per frame. Every frame we are decreasing the x position of the background by a specific number of pixels, if the background position is exactly 0, we draw the background only once at the position 0; else we draw the background twice in a row: at position x (which is always a negative number) and at position x + width of the backround. It doesn’t matter if we are drawing off screen, Android supports clipping very well. Another popular effect in 2D games is parallax scrolling to achieve scene depth. It can be done by drawing multiple infinite backgrounds which are moving at different speeds.

I’ve done also the basic main character controls. The bird is pulled down every frame by the gravity and it’s speed is increasing. When the player taps the screen, a specific amount of speed is added to birds speed, so the bird is flying upwards. I’ve set also birds maximum speed in both directions to smooth the gameplay a little bit.

The next thing is generating, drawing and animating the tubes. For this part I’ve created a tube class which holds the x position, the y position of the gap and two flags if the player passed the tube. The tubes are generated at a constant distance (which is configurable), with a random gap position (the gap height is also configurable). On every frame I update the x position for moving and the flags if the player passed the tube; flags are crucial later on for performance, since I don’t want to process tubes which are already passed or outside of the screen.

Since the player can already pass the tubes it’s time to implement scoring. For every passed tube, the score is increasing by one. I’ve also finished persisting the high score on the device.

Some basic gameplay stuff is finished and I’ve started with the splash screen. It should show only the logo with some fade in/out effects; very easy and straight forward.

Last but not least, I’ve spent some time drawing the actual font for scoring. The font will contain only numbers for now.

       

* * * * *

Flappy Beard [Day 1] – Introduction

Welcome to another development journal, this time covering the making of a Flappy Bird clone. Since the original game is very simple to develop, I’ll try to make this journal as detailed as possible. All of the original game features will be explained followed with many screenshots.

This project is also developed completely in my free time when I’m not spending time with my family or watching the World Cup. Since the original game is developed in a couple of days, I’ve set also a deadline to make things more interesing. I’ll try to finish the game in only 24 (twenty four) hours during the next seven days. I’m not completely sure if I’m going to use the original graphics, but what I know for sure is that the main character will have a beard, so the name of the game will be: Flappy Beard.

Let the game making fun begin…

When I was starting my last project which is also a 2D game, I couldn’t decide which drawing technique shall I use, Canvas drawing or OpenGL. So I’ve spent again a little bit of time reading articles related to 2D graphics on Android. OpenGL is very fast, hardware accelerated, but the effort to create all the polygon drawing and texturing routines is giving me headaches, especially when it comes to a small project like this. I didn’t want also to run into further dilemmas should I use OpenGL version 1 or 2, so I’ve decided to explore drawing to Canvas.

After further research I’ve found out that the best way is to use the SurfaceView which is a simple view that runs in a separate thread and it’s also hardware accelerated from Android 3.0+ versions. I’ve created the project, setup the view and added also methods for passing touch events to the view. To test if everything is working correctly I’ve drawn a little circle on the screen which you can move around by touching the view. Yey – my first 2D game for Android using Canvas. To avoid any obsolete drawing, calculating or resource leaking, the second thing that every developer implements is the FPS (frames per second) counter in the upper left corner of the screen. Android maximum framerate is 60 frames per second.

* * * * *
* * * * *
* * * * *

Laser Squad [Day 63] – Displaying unit info and inventory

This must be the most unproductive month since I started the project. I barely found some free time to work on the project by the end of the month.

I’m still working on the game setup part. Now, when the player is equipping units, I wanted to display also unit attributes, so appropriate equipment can be chosen for the units. I’m still having trouble to organize the UI in this mode of the game, I hope everything will look fine also on devices with smaller resolution.

 

* * * * *
* * * * *

Laser Squad [Day 62] – Continuing with the Game Setup screen

It’s been a while since my last post. I’m occupied with other things and I barely have time to work on my project. I’m still on the setup screen, mainly designing the armoring and equipping units part.

The good news is that I repaired my phone, and I’m happy that my device is working like before. Therefore I attached some screenshots of the first part of the Game Setup screen below (day 58).

* * * * *

Laser Squad [Day 61] – Development onResume

After a one month break, I’m continuing my work on the game. I still didn’t fix my phone, so all screenshots from the current version of the game will be posted later.

Today I needed a couple of hours to analyze the code and see where I stopped with development. Currently I’m working on the game setup, where the player needs to equip his units with armor.

* * * * *

Laser Squad [Day 60] – Development onPause

I’m on a one-month vacation since yesterday. During my vacation I planned to test the whole game and all the things I did so far. Unfortunately after the first day of my vacation I dropped my Nexus on the floor. The display is totally broken, and touch events don’t work. Since this is the main development and test device, I’m unable to test and post screenshots until I fix my phone.

* * * * *
* * * * *