A downloadable game for Windows

Download NowName your own price

FlappyBird is a fairly simple mobile title that came out originally in 2013. The player controls a bird, constantly falling due to gravity, that can “flap” when the player taps the screen. You score points in the game by successfully navigating through an endless onslaught of tubes, that come in pairs, stretching from the ceiling down, or from the ground up, leaving a small area in the middle for the bird to pass through. The goal of the game is to survive as long as possible and attain the highest score.

I let Flappybird become a bit larger of a project than it originally could have been because I wanted to give it a bit more life than I felt Pong had. I took a break in between finishing Pong and starting this game to focus more on the VIPO for a bit, but when I came back to this game it was with a determination to improve on what I had learned already in Godot. For this project I tried to use more of the built in elements of the engine and ran into some unexpected complications with that.

Assets

For this project, I wanted to move away from the basic engine textures and used assets from some of the packs made available by Kenney. Additionally, I used a single sound effect in the project, to help indicate when a goal had been achieved. The sound effect for this was obtained from Pixabay.

Built-In Physics

Since gravity pulling the character down is featured as the main mechanic, I wanted to try using Godot’s built-in physics system for this project. I used the default gravity settings to pull the character down. Godot had a way to add a quick impulse to an object so I was able to use that to propel the character up. As I expect was the case in the original game, the character doesn’t actually move anywhere besides up and down - the obstacles on the map are all that move.

Since the player was to lose if they fell too far down on the screen, and since that behavior was the same as if the player were to hit one of the obstacles, I have a hidden obstacle rotated 90 degrees just under the camera view.

Endless Obstacles:

For the most authentic experience when it came to playing the game, I didn’t want to just have some large number of obstacles spawn. Instead, I created a system to spawn endless obstacles, giving them a specific height and width between previously spawned obstacles so that the experience is always a little different, without being considered impossible. Additionally, these extra obstacles were destroyed shortly after passing the player’s camera view. At the time of writing, there’s only ever about 8 obstacles actually spawned in the game at one time.

Background:

One big element of this game that Pong didn’t have was any kind of environment or background whatsoever to appreciate while the game goes on. For this project, I wanted to change that, bringing in another asset pack to put together something similar in essence to the original FlappyBird. Originally the background was just going to be a static backdrop that never changed. After getting some of the obstacles moving around endlessly, I wound up implementing a slower version of the same logic onto the background objects. This gave a light Parallax Scrolling effect that I think turned out really nicely.

UI:

I used a lot of the same UI from Pong for this project, editing it only a bit here and there where necessary. The font and the “main menu” in the beginning are all reused assets from The Wheel project. The hardest thing to add in was the delayed timer between leaving the main menu and starting the game itself.

Complications

Resetting the entire game anytime the player collided with something wound up being the hardest part of the entire project, bar none. The reason for this was specifically around getting the player to teleport back to the same starting position. For whatever reason, attempting to relocate the player by assigning their position directly would cause them to teleport to where I wanted for a frame, before going back to where it was originally. It took several days of experimenting and researching before I learned of two things I needed to do. The first of which was to use a built in Godot function called _IntegrateForces. This allowed me to control the position at a level I couldn’t before. The second, is that in the Godot editor, I found that the character was disabling its collision component. I had to force it to keep that component active in order to handle its collisions correctly.

Stretch Goal Implementation:

Stretch goals for this project included maintaining a local high score value in the UI. Local meaning that this value isn’t saved to the player’s system, so it’ll be reset to 0 every time they load up the game, but as they play the game it’ll maintain that high score to see if they can beat their local score. Technically the parallax scrolling was also a stretch goal, just one I implemented as soon as I got to working on the background. Giving the character dynamic reactions to the actions happening in the game was the final stretch goal I was able to implement. The character had facial changes when it jumped, when it scored a goal, and when it died.

Published 3 days ago
StatusReleased
PlatformsWindows
AuthorGrape Jelly Games

Download

Download NowName your own price

Click download now to get access to the following files:

FlapBird.zip 59 MB

Leave a comment

Log in with itch.io to leave a comment.