flappy-bird/features_spoiler.md
2024-04-17 22:29:59 +02:00

4.4 KiB

Features Solution Pointers

As we want to support self-made solutions as well as the example solution, we're going to give pointers on where to start to implement these features. However, we'll avoid hard references to the example solution.

Basic

1. Randomize Pipe Color

You should have a Sprite node for your towers. Presumably, that node has the tower texture, which you can see on the right-hand side of your screen in the Inspector tab. Look for the visibility item underneath CanvasItem. In there, you'll find Modulate. You can use modulate to apply a filter over the texture. Select a color by clicking on the white color picker. Load up your game, and you'll see that the colors of all the pipes have changed!

Now it's up to you to convert it to code and to randomize the value for each pipe :)

2. 3 Lives

This feature consists of 3 subproblems:

  1. How do you count the number of times the bird has died?
  2. How do you show this information to the user?
  3. What do you do when someone dies but still has a life left?

The first problem (1) is the easiest. You can use a variable to keep track of the number of lives. The second problem (2) is already a bit trickier. You'll have to add UI to display this information. You should already have a way to display the current and best score. You can add the number of lives to that scene. The most difficult problem is the last one. There are multiple possible solutions, but we'll only go over one in detail: invincibility. A solution is to make the user invincible for the next x seconds. We recommend using a Timer node. There's only one problem left: what if the bird died because they hit the ground or ceiling? Do you teleport them to the center of the screen? Do you restrict it so that they can't go out of the screen, or do you allow them to go out of the screen and deduct another life when the invincibility timer ends? We'll let you decide; part of game-making is deciding which mechanics and game logic make the most sense for your project.

3. Speed Increase

This one sounds very easy, but multiplying the speed variable by a percentage every time _process is called isn't the right way. That particular function might get called more often on your PC than on mine. Try to think of a fair way to increase the speed at the same rate for everyone!

Medium

1. UI

It's time to enhance the UI! Do you want to go for an old-school UI or a more modern layout? It's all up to you! You can make it as difficult as you like. Some ideas are:

  • Display icons for the amount of lives left.
  • Add a startup screen.
  • Support a toggleable night mode background (sprite is included).
  • Use sprite numbers to show the current score.

2. Coins

Depending on your implementation of Flappy Bird, you might need to add a new scene. Think about what nodes the coins should exist. It should have a sprite, and you should be able to detect any collisions. Therefore, we suggest using a Sprite2D and a CollisionShape2D inside an Area2D. Once you have your scene layout, it's time to think about the signals. You can get away with only one signal, area_exited. It's up to you if you want to connect to the signal from the Coin scene or the Player scene. The last two steps are spawning in the coins and showing the data. We'll let solving those parts over to you.

3. Random Pipe Gaps

Depending on your implementation, this might be very easy or might prove to be quite difficult. We're going to assume you're using the same logic as the example implementation.

Advanced

If you've reached this point, we're assuming that you're almost a Godot master. Unfortunately, this means the tips on how to achieve the following features will be almost nonexistent.

1. Multiplayer

As the author of this document has 0 experience with multiplayer, you're unfortunately on your own! But don't be afraid; I've heard it's easier than you would think...

2. Powerups

Be creative! You can make this as easy or as hard as you want. Some ideas are:

  • Extra life.
  • Speed boost + invincibility.
  • Coin magnet.
  • Ability to knock down pipes for a certain period.

3. Add a new type of pipe that moves

The biggest challenge might be deciding which node to use. Choose carefully between

  • Area2D
  • StaticBody2D
  • CharacterBody2D
  • RigidBody2D

This part of the documentation will help

Super Advanced

1. Battlepass

Please don't.