Setup
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.FlappyBird.iml
|
||||
/contentModel.xml
|
||||
/modules.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,5 @@
|
||||
<Project Sdk="Godot.NET.Sdk/3.3.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlappyBird", "FlappyBird.csproj", "{AEDC3644-E31C-4017-8BAC-79F4900AFB3F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
ExportDebug|Any CPU = ExportDebug|Any CPU
|
||||
ExportRelease|Any CPU = ExportRelease|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AEDC3644-E31C-4017-8BAC-79F4900AFB3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AEDC3644-E31C-4017-8BAC-79F4900AFB3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AEDC3644-E31C-4017-8BAC-79F4900AFB3F}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
|
||||
{AEDC3644-E31C-4017-8BAC-79F4900AFB3F}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
|
||||
{AEDC3644-E31C-4017-8BAC-79F4900AFB3F}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
|
||||
{AEDC3644-E31C-4017-8BAC-79F4900AFB3F}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,57 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://assets/textures/ground.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scripts/Ground.cs" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 304, 83.2957 )
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "GroundMove"
|
||||
length = 0.5
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 252, 772 ), Vector2( 180, 772 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Sprite2:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 756, 772 ), Vector2( 684, 772 ) ]
|
||||
}
|
||||
|
||||
[node name="Ground" type="Area2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 180, 772 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite2" type="Sprite" parent="."]
|
||||
position = Vector2( 684, 772 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 248, 768 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
autoplay = "GroundMove"
|
||||
anims/GroundMove = SubResource( 2 )
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_Ground_player_entered"]
|
||||
@@ -0,0 +1,56 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Ground.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://assets/textures/background.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/fonts/flappyfont.TTF" type="DynamicFontData" id=4]
|
||||
[ext_resource path="res://scripts/Menu.cs" type="Script" id=5]
|
||||
[ext_resource path="res://assets/textures/message.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 77
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[node name="Menu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 5 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
|
||||
[node name="Ground" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 0, 8 )
|
||||
|
||||
[node name="Overlay" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Score" type="Label" parent="Overlay"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -240.0
|
||||
margin_right = 240.0
|
||||
margin_bottom = 160.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_offset_x = 2
|
||||
custom_constants/shadow_offset_y = 2
|
||||
custom_constants/shadow_as_outline = 2
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 72, 427 )
|
||||
gravity_scale = 0.0
|
||||
script = null
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 240, 352 )
|
||||
texture = ExtResource( 6 )
|
||||
@@ -0,0 +1,41 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://assets/textures/pipe.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scripts/Obstacle.cs" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 39.216, 239.928 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 40, 80 )
|
||||
|
||||
[node name="Obstacle" type="Area2D"]
|
||||
position = Vector2( 528, 0 )
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Pipe" type="Area2D" parent="."]
|
||||
position = Vector2( 0, 736 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Pipe"]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Pipe"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Pipe2" type="Area2D" parent="."]
|
||||
position = Vector2( 0, 96 )
|
||||
rotation = 3.14159
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Pipe2"]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Pipe2"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Score" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 0, 416 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[connection signal="body_exited" from="." to="." method="_on_Obstacle_player_exited"]
|
||||
[connection signal="body_entered" from="Pipe" to="." method="_on_Pipe_player_entered"]
|
||||
[connection signal="body_entered" from="Pipe2" to="." method="_on_Pipe_player_entered"]
|
||||
@@ -0,0 +1,43 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://assets/textures/bird.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scripts/Player.cs" type="Script" id=2]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 17.7871
|
||||
height = 18.8992
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "Flap"
|
||||
length = 0.3
|
||||
loop = true
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.1, 0.2 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0, 1, 2 ]
|
||||
}
|
||||
|
||||
[node name="Player" type="RigidBody2D"]
|
||||
gravity_scale = 5.0
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
hframes = 3
|
||||
frame = 1
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( -1.23744, 0 )
|
||||
rotation = 1.5708
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
autoplay = "Flap"
|
||||
anims/Flap = SubResource( 2 )
|
||||
@@ -0,0 +1,56 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://assets/textures/background.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Ground.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://assets/textures/gameover.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/fonts/flappyfont.TTF" type="DynamicFontData" id=5]
|
||||
[ext_resource path="res://scripts/World.cs" type="Script" id=6]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 77
|
||||
font_data = ExtResource( 5 )
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
script = ExtResource( 6 )
|
||||
|
||||
[node name="Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="Ground" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 0, 8 )
|
||||
|
||||
[node name="Overlay" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Score" type="Label" parent="Overlay"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -240.0
|
||||
margin_right = 240.0
|
||||
margin_bottom = 160.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_offset_x = 2
|
||||
custom_constants/shadow_offset_y = 2
|
||||
custom_constants/shadow_as_outline = 2
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 1.65
|
||||
autostart = true
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 72, 427 )
|
||||
|
||||
[node name="GameOver" type="Sprite" parent="."]
|
||||
visible = false
|
||||
position = Vector2( 232, 384 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
|
||||
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/die.wav-087ffdeea77da2d281dd49bf11cf0272.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/die.wav"
|
||||
dest_files=[ "res://.import/die.wav-087ffdeea77da2d281dd49bf11cf0272.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/hit.wav-96dc477cdf4a42f381370dba6e3f75ce.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/hit.wav"
|
||||
dest_files=[ "res://.import/hit.wav-96dc477cdf4a42f381370dba6e3f75ce.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/point.wav-d840f64e07b7f377e5e25715de9c8870.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/point.wav"
|
||||
dest_files=[ "res://.import/point.wav-d840f64e07b7f377e5e25715de9c8870.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/swoosh.wav-f1965cef42c3cf734b24307307f51fd3.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/swoosh.wav"
|
||||
dest_files=[ "res://.import/swoosh.wav-f1965cef42c3cf734b24307307f51fd3.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/wing.wav-14f21070462e312549de62a6e5a3deb4.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/wing.wav"
|
||||
dest_files=[ "res://.import/wing.wav-14f21070462e312549de62a6e5a3deb4.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/background.png-db55ec47224fbca7de3496d6823058f9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/background.png"
|
||||
dest_files=[ "res://.import/background.png-db55ec47224fbca7de3496d6823058f9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
After Width: | Height: | Size: 797 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bird.png-c92121613a657ce6291de8e14467a3aa.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/bird.png"
|
||||
dest_files=[ "res://.import/bird.png-c92121613a657ce6291de8e14467a3aa.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
After Width: | Height: | Size: 753 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/gameover.png-946e8fcf915159ca3d67a237cc9185d9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/gameover.png"
|
||||
dest_files=[ "res://.import/gameover.png-946e8fcf915159ca3d67a237cc9185d9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
After Width: | Height: | Size: 561 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/ground.png-1c656240c2e4e7695bb1d95ac269a933.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/ground.png"
|
||||
dest_files=[ "res://.import/ground.png-1c656240c2e4e7695bb1d95ac269a933.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
After Width: | Height: | Size: 998 B |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/logo.png-0f96317da5ff1739435d5950a05f0dfb.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/logo.png"
|
||||
dest_files=[ "res://.import/logo.png-0f96317da5ff1739435d5950a05f0dfb.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/message.png-2aad12e66983c1700549fd5e505528cb.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/message.png"
|
||||
dest_files=[ "res://.import/message.png-2aad12e66983c1700549fd5e505528cb.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/pipe.png-a2176cf7a4c88df57e6290aabfe0de3a.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/textures/pipe.png"
|
||||
dest_files=[ "res://.import/pipe.png-a2176cf7a4c88df57e6290aabfe0de3a.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,7 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -0,0 +1,43 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
[application]
|
||||
|
||||
config/name="FlappyBird"
|
||||
run/main_scene="res://Menu.tscn"
|
||||
config/icon="res://assets/textures/logo.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=480
|
||||
window/size/height=854
|
||||
window/handheld/orientation="sensor_portrait"
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[input]
|
||||
|
||||
Click={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[input_devices]
|
||||
|
||||
pointing/emulate_touch_from_mouse=true
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
@@ -0,0 +1,14 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class Ground : Area2D
|
||||
{
|
||||
private void _on_Ground_player_entered(object body)
|
||||
{
|
||||
if (body is Player)
|
||||
{
|
||||
Player player = body as Player;
|
||||
player.die();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class Menu : Control
|
||||
{
|
||||
public override void _Process(float delta)
|
||||
{
|
||||
if (Input.IsActionJustPressed("Click"))
|
||||
{
|
||||
GetTree().ChangeScene("res://World.tscn");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class Obstacle : Area2D
|
||||
{
|
||||
private const float moveSpeed = 145f;
|
||||
|
||||
|
||||
private void _on_Pipe_player_entered(object body)
|
||||
{
|
||||
if (body is Player)
|
||||
{
|
||||
Player player = body as Player;
|
||||
player.die();
|
||||
}
|
||||
}
|
||||
|
||||
private void _on_Obstacle_player_exited(object body)
|
||||
{
|
||||
if (body is Player)
|
||||
{
|
||||
Player player = body as Player;
|
||||
player.score_increase();
|
||||
}
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(float delta)
|
||||
{
|
||||
Translate(new Vector2(-moveSpeed * delta, 0));
|
||||
|
||||
if (Position.x < -200)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class Player : RigidBody2D
|
||||
{
|
||||
private const float jumpForce = -225f;
|
||||
private bool alive = true;
|
||||
private int score = 0;
|
||||
private Label labelScore;
|
||||
private ulong timeDied = 0;
|
||||
private const int respawnTime = 3;
|
||||
private Sprite spriteGameOver;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
labelScore = GetNode<Label>("../Overlay/Score");
|
||||
spriteGameOver = GetNode<Sprite>("../GameOver");
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(float delta)
|
||||
{
|
||||
if (Input.IsActionJustPressed("Click") && alive)
|
||||
{
|
||||
LinearVelocity = new Vector2(0, jumpForce);
|
||||
}
|
||||
|
||||
if (!alive && OS.GetUnixTime() - timeDied > respawnTime)
|
||||
{
|
||||
GetTree().ChangeScene("res://Menu.tscn");
|
||||
}
|
||||
}
|
||||
|
||||
public void die()
|
||||
{
|
||||
if(alive)
|
||||
{
|
||||
alive = false;
|
||||
GravityScale = 0;
|
||||
timeDied = OS.GetUnixTime();
|
||||
spriteGameOver.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void score_increase()
|
||||
{
|
||||
if(alive)
|
||||
{
|
||||
score++;
|
||||
labelScore.Text = score.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Object = Godot.Object;
|
||||
|
||||
public class World : Node2D
|
||||
{
|
||||
//-260 240
|
||||
private Sprite spriteBackground;
|
||||
private PackedScene prefabObstacle = GD.Load<PackedScene>("res://Obstacle.tscn");
|
||||
private Random random = new Random();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
spriteBackground = GetNode<Sprite>("Background");
|
||||
}
|
||||
|
||||
private void _on_Timer_timeout()
|
||||
{
|
||||
Area2D instance = prefabObstacle.Instance() as Area2D;
|
||||
instance.Position = new Vector2(instance.Position.x, random.Next(-260, 140));
|
||||
spriteBackground.AddChild(instance);
|
||||
}
|
||||
}
|
||||