docs: added readme's

This commit is contained in:
Topvennie 2024-04-17 22:29:59 +02:00
parent 88a4d7d768
commit af4cdd6a3a
3 changed files with 145 additions and 0 deletions

41
README.md Normal file
View file

@ -0,0 +1,41 @@
# Flappy Bird
This repository contains an example solution for the [Flappy Bird game](https://git.zeus.gent/godot-introduction/getting-started/src/branch/master/flappy-bird).
It's important to note that this is not the only possible solution; yours might differ.
Now that you have starting solution, it's time to add some new and exciting features!
However ,before you start adding new features, it might be a good idea to fix all lingering bugs.
## Bugs
It's a good exercise to try and find a solution on your own; however, if you're really stuck we've added some pointers in the `bugs_spoilers.md` file.
1. It's possible to jump above the pipes. By spamming SPACE you'll never die.
2. When you die because of hitting a pipe, the bird gets reset to the starting position. It would be nicer if it had the same type of ending screen as when you hit the gound, which is the last frame you see.
## New Features
We're using the same method as for the bugs. You can find some pointers, if necessary, on where to begin in `features_spoilers.md`.
### Basic
1. Randomize the color of the pipes
2. Give the player 3 lives.
3. Increase the speed of the bird as the game progresses
### Medium
1. Enchance the UI
2. Add Coins
3. Randomize the size of the gap between pipes
### Advanced
1. Support multiple players
2. Powerups
3. Add a new type of pipe that moves
### Super Advanced
1. Monetize the game by adding a battlepass

17
bugs_spoilers.md Normal file
View file

@ -0,0 +1,17 @@
# Bugs Solution Pointers
As bugs are unique to a certain solution, we'll make references to the code of the example solution. If your own solution has the same bug, the general fix idea can be reused.
## 1. No height limit
As you might have noticed, the game ends when you hit the floor. This gives you the opportunity to recycle some code!
You can look at how that is done in `Player.gd`.
## 2. Ending Screen
Again, you can look at already existing code. Try to look at the differences when you hit the floor and when you hit a tower.
You already know where the check is done if you hit the floor. Checking if a tower is hit is done in the same file.
Hint: Select the Area2D node and look at the attached signals

87
features_spoiler.md Normal file
View file

@ -0,0 +1,87 @@
# 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](https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html) will help
## Super Advanced
### 1. Battlepass
Please don't.