-
-
Notifications
You must be signed in to change notification settings - Fork 71
Feature/20250901 flappy bird #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LeandroCustodio2002
wants to merge
14
commits into
popcar2:main
Choose a base branch
from
LeandroCustodio2002:feature/20250901-flappyBird
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
db19be5
flappy bird first version
LeandroCustodio2002 dc536bc
add coin system
LeandroCustodio2002 2be79ba
game over
LeandroCustodio2002 19fc1ba
fix death screen
LeandroCustodio2002 2d9d758
ui adjustments
LeandroCustodio2002 4b77f4f
points system improvements
LeandroCustodio2002 980f3c2
add parallax background
LeandroCustodio2002 65f8e97
add sfx by audio stream player generator
LeandroCustodio2002 ffcf207
add song system
LeandroCustodio2002 3b38588
Fix static typing issues in scripts
LeandroCustodio2002 29a7f78
add game in search bar
LeandroCustodio2002 043fc72
adjustments
LeandroCustodio2002 cbdace8
add medal system
LeandroCustodio2002 8a4e304
refactor: adjust file and script naming
LeandroCustodio2002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[gd_scene load_steps=8 format=3 uid="uid://dckhk4qtic5wn"] | ||
|
||
[ext_resource type="Script" uid="uid://c2qcftvj6c06a" path="res://Games/Flappy Pixel/scripts/flappy_main.gd" id="1_4fqwn"] | ||
[ext_resource type="PackedScene" uid="uid://blyopvsq7qfb4" path="res://Games/Flappy Pixel/scenes/objects/flappy_pipe.tscn" id="2_e2vp3"] | ||
[ext_resource type="PackedScene" uid="uid://dc602m1dy8vif" path="res://Games/Flappy Pixel/scenes/objects/flappy_coin.tscn" id="3_crr33"] | ||
[ext_resource type="PackedScene" uid="uid://bxnhjob8r08ie" path="res://Games/Flappy Pixel/scenes/objects/flappy_background.tscn" id="4_slf1g"] | ||
[ext_resource type="PackedScene" uid="uid://cnw1puljx6xw7" path="res://Games/Flappy Pixel/scenes/player/flappy_bird.tscn" id="5_tw2t4"] | ||
[ext_resource type="PackedScene" uid="uid://dtveya3dnp8hj" path="res://Games/Flappy Pixel/scenes/ui/flappy_deathScreen.tscn" id="6_fapkm"] | ||
|
||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_lovuv"] | ||
size = Vector2(1160, 52) | ||
|
||
[node name="Main" type="Node2D"] | ||
script = ExtResource("1_4fqwn") | ||
pipe = ExtResource("2_e2vp3") | ||
coin = ExtResource("3_crr33") | ||
|
||
[node name="Background" parent="." instance=ExtResource("4_slf1g")] | ||
|
||
[node name="Bird" parent="." instance=ExtResource("5_tw2t4")] | ||
position = Vector2(82, 278) | ||
|
||
[node name="Area2D" type="StaticBody2D" parent="."] | ||
collision_layer = 2 | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] | ||
position = Vector2(578, 625) | ||
shape = SubResource("RectangleShape2D_lovuv") | ||
|
||
[node name="ColorRect2" type="ColorRect" parent="Area2D"] | ||
offset_left = -1.0 | ||
offset_top = 607.0 | ||
offset_right = 1159.0 | ||
offset_bottom = 651.0 | ||
color = Color(0.92, 0.92, 0.92, 1) | ||
|
||
[node name="ColorRect" type="ColorRect" parent="Area2D"] | ||
offset_left = -1.0 | ||
offset_top = 597.0 | ||
offset_right = 1159.0 | ||
offset_bottom = 611.0 | ||
|
||
[node name="Timer" type="Timer" parent="."] | ||
|
||
[node name="DeathScreen" parent="." instance=ExtResource("6_fapkm")] | ||
|
||
[connection signal="died" from="Bird" to="." method="_on_bird_died"] | ||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] | ||
[connection signal="start_game" from="DeathScreen" to="." method="_on_death_screen_start_game"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[gd_scene load_steps=5 format=3 uid="uid://bxnhjob8r08ie"] | ||
|
||
[ext_resource type="Script" uid="uid://v2chs0uam0wb" path="res://Games/Flappy Pixel/scripts/flappy_background.gd" id="1_e4yoa"] | ||
[ext_resource type="Texture2D" uid="uid://bgvss615ybbd2" path="res://Games/Flappy Pixel/sprites/flappy_bg1.png" id="1_j6x65"] | ||
[ext_resource type="Texture2D" uid="uid://ca5m5xb631klu" path="res://Games/Flappy Pixel/sprites/flappy_bg2.png" id="2_3dnfs"] | ||
[ext_resource type="Texture2D" uid="uid://bdg4nbj78bp" path="res://Games/Flappy Pixel/sprites/flappy_bg3.png" id="2_e4yoa"] | ||
|
||
[node name="Background" type="ParallaxBackground"] | ||
script = ExtResource("1_e4yoa") | ||
|
||
[node name="ColorRect" type="ColorRect" parent="."] | ||
offset_right = 1159.0 | ||
offset_bottom = 651.0 | ||
color = Color(0, 0, 0, 1) | ||
|
||
[node name="ParallaxLayer" type="ParallaxLayer" parent="."] | ||
motion_scale = Vector2(0.5, 0.5) | ||
motion_mirroring = Vector2(1200, 0) | ||
|
||
[node name="Bg1" type="Sprite2D" parent="ParallaxLayer"] | ||
position = Vector2(600, 507) | ||
texture = ExtResource("1_j6x65") | ||
|
||
[node name="ParallaxLayer2" type="ParallaxLayer" parent="."] | ||
motion_scale = Vector2(0.7, 0.7) | ||
motion_mirroring = Vector2(1200, 0) | ||
|
||
[node name="Bg1" type="Sprite2D" parent="ParallaxLayer2"] | ||
position = Vector2(601, 507) | ||
texture = ExtResource("2_e4yoa") | ||
|
||
[node name="ParallaxLayer3" type="ParallaxLayer" parent="."] | ||
motion_mirroring = Vector2(1200, 0) | ||
|
||
[node name="Bg1" type="Sprite2D" parent="ParallaxLayer3"] | ||
position = Vector2(600, 507) | ||
texture = ExtResource("2_3dnfs") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://dc602m1dy8vif"] | ||
|
||
[ext_resource type="Script" uid="uid://b1msnbmw5lq3a" path="res://Games/Flappy Pixel/scripts/flappy_coin.gd" id="1_n078p"] | ||
[ext_resource type="Texture2D" uid="uid://bg3t4t8x526xm" path="res://Games/Flappy Pixel/sprites/flappy_pixel.png" id="1_uerfd"] | ||
|
||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_n078p"] | ||
size = Vector2(0.796875, 0.742188) | ||
|
||
[node name="Coin" type="Area2D"] | ||
script = ExtResource("1_n078p") | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] | ||
position = Vector2(0, -0.0625) | ||
scale = Vector2(16, 16) | ||
shape = SubResource("RectangleShape2D_n078p") | ||
|
||
[node name="Pixel" type="Sprite2D" parent="."] | ||
modulate = Color(1, 0.88, 0.2, 1) | ||
scale = Vector2(16, 16) | ||
texture = ExtResource("1_uerfd") | ||
|
||
[connection signal="body_entered" from="." to="." method="_on_body_entered"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://blyopvsq7qfb4"] | ||
|
||
[ext_resource type="Script" uid="uid://dnm4261vtpepu" path="res://Games/Flappy Pixel/scripts/flappy_pipe.gd" id="1_mvpjc"] | ||
|
||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yy4kw"] | ||
size = Vector2(78, 456) | ||
|
||
[node name="Pipe" type="Node2D"] | ||
script = ExtResource("1_mvpjc") | ||
|
||
[node name="Area2D2" type="StaticBody2D" parent="."] | ||
collision_layer = 2 | ||
|
||
[node name="ColorRect" type="ColorRect" parent="Area2D2"] | ||
offset_left = -40.0 | ||
offset_top = 112.0 | ||
offset_right = 40.0 | ||
offset_bottom = 572.0 | ||
|
||
[node name="ColorRect2" type="ColorRect" parent="Area2D2"] | ||
offset_left = -45.0 | ||
offset_top = 108.0 | ||
offset_right = 45.0 | ||
offset_bottom = 127.0 | ||
color = Color(0.77, 0.77, 0.77, 1) | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D2"] | ||
position = Vector2(0, 340) | ||
shape = SubResource("RectangleShape2D_yy4kw") | ||
|
||
[node name="Area2D3" type="StaticBody2D" parent="."] | ||
collision_layer = 2 | ||
|
||
[node name="ColorRect" type="ColorRect" parent="Area2D3"] | ||
offset_left = -39.0 | ||
offset_top = -560.0 | ||
offset_right = 41.0 | ||
offset_bottom = -103.0 | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D3"] | ||
position = Vector2(1, -331) | ||
shape = SubResource("RectangleShape2D_yy4kw") | ||
|
||
[node name="ColorRect2" type="ColorRect" parent="Area2D3"] | ||
offset_left = -44.0 | ||
offset_top = -120.0 | ||
offset_right = 46.0 | ||
offset_bottom = -101.0 | ||
color = Color(0.77, 0.77, 0.77, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[gd_scene load_steps=9 format=3 uid="uid://cnw1puljx6xw7"] | ||
|
||
[ext_resource type="Script" uid="uid://cc6d3safsb85a" path="res://Games/Flappy Pixel/scripts/flappy_bird.gd" id="1_vpwia"] | ||
[ext_resource type="PackedScene" uid="uid://gi62pdwhveux" path="res://Games/Flappy Pixel/scenes/player/flappy_shadowEffect.tscn" id="2_1pmq1"] | ||
[ext_resource type="PackedScene" uid="uid://cfrfprsuri0dd" path="res://Games/Flappy Pixel/scenes/ui/flappy_hud.tscn" id="3_dojqc"] | ||
[ext_resource type="Script" uid="uid://d03p5wc715855" path="res://Games/Flappy Pixel/scripts/flappy_sfx.gd" id="4_lusbn"] | ||
[ext_resource type="Script" uid="uid://begc847717o53" path="res://Games/Flappy Pixel/scripts/flappy_song.gd" id="5_0jpsh"] | ||
|
||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_m557x"] | ||
size = Vector2(36, 36) | ||
|
||
[sub_resource type="AudioStreamGenerator" id="AudioStreamGenerator_0jpsh"] | ||
|
||
[sub_resource type="AudioStreamGenerator" id="AudioStreamGenerator_n6f5r"] | ||
|
||
[node name="Bird" type="CharacterBody2D"] | ||
z_index = 1 | ||
collision_mask = 2 | ||
script = ExtResource("1_vpwia") | ||
shadow = ExtResource("2_1pmq1") | ||
|
||
[node name="ColorRect" type="ColorRect" parent="."] | ||
anchors_preset = 8 | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
offset_left = -20.0 | ||
offset_top = -20.0 | ||
offset_right = 20.0 | ||
offset_bottom = 20.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] | ||
shape = SubResource("RectangleShape2D_m557x") | ||
|
||
[node name="Hud" parent="." instance=ExtResource("3_dojqc")] | ||
|
||
[node name="sfx" type="AudioStreamPlayer2D" parent="."] | ||
stream = SubResource("AudioStreamGenerator_0jpsh") | ||
script = ExtResource("4_lusbn") | ||
|
||
[node name="song" type="AudioStreamPlayer2D" parent="."] | ||
stream = SubResource("AudioStreamGenerator_n6f5r") | ||
script = ExtResource("5_0jpsh") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://gi62pdwhveux"] | ||
|
||
[ext_resource type="Texture2D" uid="uid://bg3t4t8x526xm" path="res://Games/Flappy Pixel/sprites/flappy_pixel.png" id="1_fw6ui"] | ||
[ext_resource type="Script" uid="uid://ryjsymhbpef6" path="res://Games/Flappy Pixel/scripts/flappy_shadow_effect.gd" id="1_rj05e"] | ||
|
||
[node name="ShadowEffect" type="Sprite2D"] | ||
modulate = Color(0.19, 0.8245, 1, 1) | ||
scale = Vector2(10, 10) | ||
texture = ExtResource("1_fw6ui") | ||
script = ExtResource("1_rj05e") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://dtveya3dnp8hj"] | ||
|
||
[ext_resource type="Script" uid="uid://c74qj78qp55ot" path="res://Games/Flappy Pixel/scripts/death_screen.gd" id="1_78sdb"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xbo0y"] | ||
bg_color = Color(0, 0, 0, 1) | ||
border_width_left = 10 | ||
border_width_top = 10 | ||
border_width_right = 10 | ||
border_width_bottom = 10 | ||
|
||
[node name="DeathScreen" type="CanvasLayer"] | ||
script = ExtResource("1_78sdb") | ||
|
||
[node name="Panel" type="Panel" parent="."] | ||
anchors_preset = 8 | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
offset_left = -210.0 | ||
offset_top = -225.0 | ||
offset_right = 210.0 | ||
offset_bottom = 225.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
theme_override_styles/panel = SubResource("StyleBoxFlat_xbo0y") | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"] | ||
layout_mode = 1 | ||
anchors_preset = -1 | ||
anchor_left = 0.255 | ||
anchor_top = 0.427 | ||
anchor_right = 0.745 | ||
anchor_bottom = 0.573 | ||
offset_left = -0.100014 | ||
offset_top = -0.150009 | ||
offset_right = 0.0999756 | ||
offset_bottom = 0.149994 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
|
||
[node name="Medal" type="RichTextLabel" parent="Panel/VBoxContainer"] | ||
layout_mode = 2 | ||
fit_content = true | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
|
||
[node name="Label" type="Label" parent="Panel/VBoxContainer"] | ||
layout_mode = 2 | ||
theme_override_font_sizes/font_size = 31 | ||
text = "Game Over" | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
|
||
[node name="Label2" type="RichTextLabel" parent="Panel/VBoxContainer"] | ||
layout_mode = 2 | ||
text = "Score" | ||
fit_content = true | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
|
||
[node name="Button" type="Button" parent="Panel/VBoxContainer"] | ||
layout_mode = 2 | ||
text = "Try Again" | ||
|
||
[connection signal="pressed" from="Panel/VBoxContainer/Button" to="." method="_on_button_pressed"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://cfrfprsuri0dd"] | ||
|
||
[ext_resource type="Script" uid="uid://cb0ix1v5kxgi8" path="res://Games/Flappy Pixel/scripts/flappy_hud.gd" id="1_smeyw"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2rfwl"] | ||
bg_color = Color(0, 0, 0, 1) | ||
border_width_left = 5 | ||
border_width_top = 5 | ||
border_width_right = 5 | ||
border_width_bottom = 5 | ||
border_color = Color(1, 1, 1, 1) | ||
|
||
[node name="Hud" type="CanvasLayer"] | ||
script = ExtResource("1_smeyw") | ||
|
||
[node name="Panel" type="Panel" parent="."] | ||
anchors_preset = -1 | ||
anchor_left = 0.871 | ||
anchor_top = 0.011 | ||
anchor_right = 0.99 | ||
anchor_bottom = 0.103 | ||
offset_left = -0.39209 | ||
offset_top = -0.128001 | ||
offset_right = 0.519897 | ||
offset_bottom = 0.255997 | ||
theme_override_styles/panel = SubResource("StyleBoxFlat_2rfwl") | ||
|
||
[node name="Label" type="Label" parent="Panel"] | ||
layout_mode = 0 | ||
offset_right = 138.0 | ||
offset_bottom = 60.0 | ||
text = "points: 00" | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
extends CanvasLayer | ||
|
||
signal start_game | ||
|
||
@onready var label_title: Label = $Panel/VBoxContainer/Label | ||
@onready var label_score: RichTextLabel = $Panel/VBoxContainer/Label2 | ||
@onready var button: Button = $Panel/VBoxContainer/Button | ||
|
||
func _ready() -> void: | ||
label_title.text = "Flappy Pixel" | ||
label_score.text = "" | ||
button.text = "Start Game" | ||
|
||
func _on_button_pressed() -> void: | ||
emit_signal("start_game") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is anything using this signal? |
||
label_title.text = "Game Over" | ||
button.text = "Try Again" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uid://c74qj78qp55ot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extends ParallaxBackground | ||
|
||
var background_fundo: Vector2 = Vector2() | ||
var can_move: bool = true | ||
|
||
func _process(_delta: float) -> void: | ||
if can_move: | ||
background_fundo.x -= 1 | ||
set_scroll_offset(background_fundo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uid://v2chs0uam0wb |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set the default label text in the labels themselves, not in functions