Skip to content

Commit 195c180

Browse files
committed
Game over/begin
1 parent b0eddb1 commit 195c180

File tree

7 files changed

+84
-29
lines changed

7 files changed

+84
-29
lines changed

PokeHunt/export_presets.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ custom_features=""
77
export_filter="all_resources"
88
include_filter=""
99
exclude_filter=""
10-
export_path="export/nix/sapo.x86_64"
10+
export_path="export/linux/sapo.x86_64"
1111
script_export_mode=1
1212
script_encryption_key=""
1313

@@ -57,7 +57,7 @@ custom_features=""
5757
export_filter="all_resources"
5858
include_filter=""
5959
exclude_filter=""
60-
export_path="export/win/sapo.exe"
60+
export_path="export/windows/sapo.exe"
6161
script_export_mode=1
6262
script_encryption_key=""
6363

PokeHunt/icon.png.import

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,13 @@
11
[remap]
22

3-
importer="texture"
4-
type="StreamTexture"
5-
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
6-
metadata={
7-
"vram_texture": false
8-
}
3+
importer="image"
4+
type="Image"
5+
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.image"
96

107
[deps]
118

129
source_file="res://icon.png"
13-
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
10+
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.image" ]
1411

1512
[params]
1613

17-
compress/mode=0
18-
compress/lossy_quality=0.7
19-
compress/hdr_mode=0
20-
compress/bptc_ldr=0
21-
compress/normal_map=0
22-
flags/repeat=0
23-
flags/filter=true
24-
flags/mipmaps=false
25-
flags/anisotropic=false
26-
flags/srgb=2
27-
process/fix_alpha_border=true
28-
process/premult_alpha=false
29-
process/HDR_as_SRGB=false
30-
process/invert_color=false
31-
stream=false
32-
size_limit=0
33-
detect_3d=true
34-
svg/scale=1.0

PokeHunt/project.godot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ config/name="Poke Hunt"
1414
run/main_scene="res://scenes/World.tscn"
1515
config/icon="res://icon.png"
1616

17+
[debug]
18+
19+
settings/stdout/print_fps=true
20+
1721
[display]
1822

1923
window/size/width=1280

PokeHunt/scenes/Sapo.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ surfaces/0 = {
2020
[sub_resource type="BoxShape" id=2]
2121
extents = Vector3( 4.53344, 5.03517, 3.91756 )
2222

23-
[node name="Sapo" type="StaticBody"]
23+
[node name="Sapo" type="Area"]
2424
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0 )
2525

2626
[node name="Mesh" type="MeshInstance" parent="."]

PokeHunt/scenes/World.tscn

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
[gd_scene load_steps=5 format=2]
1+
[gd_scene load_steps=8 format=2]
22

33
[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=1]
44
[ext_resource path="res://scenes/Boat.tscn" type="PackedScene" id=2]
55
[ext_resource path="res://assets/water/depth_buffer/Water.tscn" type="PackedScene" id=3]
66
[ext_resource path="res://scenes/Sapo.tscn" type="PackedScene" id=4]
7+
[ext_resource path="res://ui/fonts/Comfortaa-Bold.ttf" type="DynamicFontData" id=5]
8+
9+
[sub_resource type="BoxShape" id=1]
10+
extents = Vector3( 500, 1, 500 )
11+
12+
[sub_resource type="DynamicFont" id=2]
13+
size = 150
14+
font_data = ExtResource( 5 )
715

816
[node name="World" type="Spatial"]
917

@@ -42,3 +50,40 @@ transform = Transform( 0.05, 0, 0, 0, -0.00673909, 0.0495438, 0, -0.0495438, -0.
4250

4351
[node name="Water" parent="." instance=ExtResource( 3 )]
4452
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0186162, 0 )
53+
54+
[node name="Area" type="Area" parent="Water"]
55+
56+
[node name="CollisionShape" type="CollisionShape" parent="Water/Area"]
57+
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.92327, 0 )
58+
shape = SubResource( 1 )
59+
60+
[node name="CanvasLayer" type="CanvasLayer" parent="."]
61+
62+
[node name="CenterContainer" type="CenterContainer" parent="CanvasLayer"]
63+
anchor_right = 1.0
64+
anchor_bottom = 1.0
65+
__meta__ = {
66+
"_edit_use_anchors_": false
67+
}
68+
69+
[node name="Label" type="Label" parent="CanvasLayer/CenterContainer"]
70+
margin_left = 118.0
71+
margin_top = 312.0
72+
margin_right = 1162.0
73+
margin_bottom = 481.0
74+
grow_horizontal = 2
75+
grow_vertical = 2
76+
size_flags_horizontal = 3
77+
size_flags_vertical = 3
78+
custom_fonts/font = SubResource( 2 )
79+
custom_colors/font_color = Color( 1, 0.984314, 0.627451, 1 )
80+
text = "Voce venceu!"
81+
align = 1
82+
valign = 1
83+
84+
[node name="Timer" type="Timer" parent="."]
85+
process_mode = 0
86+
87+
[connection signal="body_entered" from="Sapo" to="Player" method="_on_Sapo_body_entered"]
88+
[connection signal="body_entered" from="Water/Area" to="Player" method="_on_Water_body_entered"]
89+
[connection signal="timeout" from="Timer" to="Player" method="_on_Timer_timeout"]

PokeHunt/scripts/Player.gd

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ onready var skeleton = $Skeleton
1313
onready var body = $CollisionShape
1414
onready var camera = $Camera
1515
onready var animator = $AnimationTree.get("parameters/playback")
16+
onready var initial_transform = self.transform
17+
onready var message = get_parent().get_node("CanvasLayer/CenterContainer/Label")
18+
onready var timer = get_parent().get_node("Timer")
1619

1720

1821
func _ready():
1922
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
23+
message.text = "Encontre\n o sapo!"
24+
timer.start(3)
2025

2126

2227
func _input(event):
@@ -111,3 +116,25 @@ func _physics_process(delta):
111116
else:
112117
snap = Vector3.ZERO
113118
vel = move_and_slide_with_snap(vel, snap, Vector3.UP, true)
119+
120+
121+
func _on_Sapo_body_entered(body):
122+
if body != self:
123+
return
124+
125+
message.text = "Você venceu!"
126+
timer.start(3)
127+
self.transform = initial_transform
128+
129+
130+
func _on_Water_body_entered(body):
131+
if body != self:
132+
return
133+
134+
message.text = "Tente\nnovamente!"
135+
timer.start(1.5)
136+
self.transform = initial_transform
137+
138+
139+
func _on_Timer_timeout():
140+
message.text = ""
134 KB
Binary file not shown.

0 commit comments

Comments
 (0)