First Prototype

This commit is contained in:
Exobyt 2024-09-15 00:04:31 +02:00
parent e18beb6c4c
commit 9e3349eec3
40 changed files with 1100 additions and 48 deletions

View file

@ -1,14 +1,37 @@
extends Node
enum GAMETIME {
MIN = 240,
MAX = 360
MIN = 60*5,
MAX = 60*6
}
var lastHealth = 10
var money = 0
var StormTimeLeft = 100
var StormThreshold = 30
var extracted = false
func resetValues():
extracted = false
money = 0
lastHealth = 10
StormTimeLeft = 100
func addMoney(n):
money += n
func setLastHealth(n):
lastHealth = n
func isStormThreshold():
return StormThreshold >= StormTimeLeft
func getStormThreshold():
return StormThreshold
func extractPlayer():
extracted = true

View file

@ -1,25 +1,75 @@
[gd_scene load_steps=4 format=3 uid="uid://sgnp11xty7i1"]
[gd_scene load_steps=10 format=3 uid="uid://sgnp11xty7i1"]
[ext_resource type="Script" path="res://scenes/game/collectionArea/collection_area.gd" id="1_c4amf"]
[ext_resource type="Texture2D" uid="uid://caaj6cyrfglu5" path="res://Assets/CollectionZone.png" id="2_4nokb"]
[ext_resource type="Texture2D" uid="uid://c3o6hrpc0fim2" path="res://Assets/Portal.png" id="2_s7bky"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_e58ei"]
size = Vector2(136, 136)
[sub_resource type="CircleShape2D" id="CircleShape2D_7mwpw"]
radius = 72.0
[node name="CollectionArea" type="Area2D"]
[sub_resource type="CircleShape2D" id="CircleShape2D_f6w8f"]
radius = 12.0
[sub_resource type="AtlasTexture" id="AtlasTexture_7rm1e"]
atlas = ExtResource("2_s7bky")
region = Rect2(0, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ubxxq"]
atlas = ExtResource("2_s7bky")
region = Rect2(128, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_dv0w3"]
atlas = ExtResource("2_s7bky")
region = Rect2(256, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_vxmh6"]
atlas = ExtResource("2_s7bky")
region = Rect2(384, 0, 128, 128)
[sub_resource type="SpriteFrames" id="SpriteFrames_g6wmf"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_7rm1e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ubxxq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dv0w3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vxmh6")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="Portal" type="Area2D"]
light_mask = 32
visibility_layer = 32
collision_layer = 32
collision_mask = 16
collision_mask = 1040
script = ExtResource("1_c4amf")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_e58ei")
shape = SubResource("CircleShape2D_7mwpw")
[node name="NavigationObstacle2D" type="NavigationObstacle2D" parent="."]
scale = Vector2(0.997855, 1)
vertices = PackedVector2Array(-32.0688, -32, 32.0688, -32, 32.0688, 32, -32.0688, 32)
avoidance_layers = 32
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_4nokb")
[node name="CollectArea" type="Area2D" parent="."]
collision_layer = 32
collision_mask = 1040
[node name="CollisionShape2D" type="CollisionShape2D" parent="CollectArea"]
shape = SubResource("CircleShape2D_f6w8f")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_g6wmf")
frame_progress = 0.634411
[connection signal="area_entered" from="CollectArea" to="." method="_on_collect_area_area_entered"]
[connection signal="body_entered" from="CollectArea" to="." method="_on_collect_area_body_entered"]

View file

@ -1,10 +1,50 @@
extends Area2D
@onready var collectArea = $CollectArea
@onready var animatedSprite = $AnimatedSprite2D
func _ready() -> void:
animatedSprite.play("default")
func _physics_process(delta: float) -> void:
cashInObject()
for i in get_overlapping_bodies():
if i.is_in_group("Player"):
if G.isStormThreshold():
moveTowardsCenter(i)
for i in get_overlapping_areas():
if i.is_in_group("Object"):
if not i.isCarryied():
moveTowardsCenter(i)
else:
scale = Vector2(1,1)
#cashInObject()
func cashInObject():
for i in get_overlapping_areas():
for i in collectArea.get_overlapping_areas():
if not i.isCarryied():
G.addMoney(i.getValue())
i.queue_free()
func moveTowardsCenter(object : Node2D):
object.global_position.y = move_toward(object.global_position.y, global_position.y, 2)
object.global_position.x = move_toward(object.global_position.x, global_position.x, 2)
object.scale.y -= 0.01
object.scale.x -= 0.01
func extractPlayer():
G.extractPlayer()
func _on_collect_area_area_entered(area: Area2D) -> void:
if area.is_in_group("Object"):
cashInObject()
func _on_collect_area_body_entered(body: Node2D) -> void:
if G.isStormThreshold():
if body.is_in_group("Player"):
extractPlayer()

View file

@ -38,7 +38,7 @@ collision_layer = 2560
script = ExtResource("2_4vapd")
damage = 1
attackCooldown = 1
normalSpeed = 80
normalSpeed = 70
[node name="CollisionShape2D" parent="." index="0"]
shape = SubResource("CircleShape2D_xq7op")

View file

@ -1,6 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://b18cf4i8v6a1"]
[gd_scene load_steps=4 format=3 uid="uid://b18cf4i8v6a1"]
[ext_resource type="Script" path="res://scenes/game/entities/entity.gd" id="1_s7hj7"]
[ext_resource type="Texture2D" uid="uid://83mf84k2pi3m" path="res://Assets/Shadow.png" id="2_nhikt"]
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_4jtw1"]
light_mode = 2
[node name="Entity" type="CharacterBody2D" groups=["Entity"]]
light_mask = 512
@ -18,3 +22,7 @@ light_mask = 4
visibility_layer = 5
z_index = 1
y_sort_enabled = true
[node name="Shadow" type="Sprite2D" parent="."]
material = SubResource("CanvasItemMaterial_4jtw1")
texture = ExtResource("2_nhikt")

View file

@ -11,9 +11,16 @@ extends "res://scenes/game/entities/entity.gd"
@onready var moneyValueLabel = $Camera2D/CanvasLayer/Control/HBoxContainer/MoneyValue
@onready var objectValue = $Camera2D/CanvasLayer/Control/ObjectValues/ObjectMoneyValue
@onready var objectValues = $Camera2D/CanvasLayer/Control/ObjectValues
@onready var stormProgress = $Camera2D/CanvasLayer/Control/Storm/ProgressBar
@onready var stormUi = $Camera2D/CanvasLayer/Control/Storm
@onready var stormTimerDamage = $StormTimerDamage
@onready var sormwarningLabel = $Camera2D/CanvasLayer/Control/STORMWARNINGLabel
@onready var camera = $Camera2D
@onready var animation = $Camera2D/CanvasLayer/Control/AnimationPlayer
var rollSpeed = maxSpeed * 5
const rollCooldown = 5.0
@ -29,7 +36,10 @@ var object = null
var lastDirection : Vector2
var lastdirectionVector : Vector2
var shownStormProgress = false
func _ready():
animation.play("Introduction")
rollCooldownBar.min_value = 0
rollCooldownBar.max_value = rollCooldown
healthBar.min_value = 0
@ -44,8 +54,18 @@ func setHudValues():
objectValue.text = str(object.getValue())
else:
objectValues.hide()
G.setLastHealth(health)
stormProgress.value = G.StormTimeLeft
if G.isStormThreshold():
if not shownStormProgress:
sormwarningLabel.show()
shownStormProgress = true
animation.play("StormTimerAppear")
stormProgress.max_value = G.getStormThreshold()
func _physics_process(delta: float) -> void:
Storm()
setHudValues()
var direction : Vector2 = Input.get_vector("MOVE_LEFT", "MOVE_RIGHT", "MOVE_UP", "MOVE_DOWN").normalized()
#var direction : Vector2 = Vector2(
@ -59,10 +79,8 @@ func _physics_process(delta: float) -> void:
lastdirectionVector = directionVector
if Input.is_action_just_pressed("ROLL") and lastDirection != Vector2.ZERO:
roll()
if Input.is_action_just_pressed("ROLL") and lastDirection != Vector2.ZERO:
roll()
if Input.is_action_just_pressed("DOOR"):
openDoor()
#if Input.is_action_just_pressed("DOOR"):
#openDoor()
if Input.is_action_just_pressed("Pickup"):
match carrying:
false:
@ -168,5 +186,22 @@ func _on_hit_box_signal_hit(damage: Variant) -> void:
camera.shake(2,0.5)
func _on_death() -> void:
print("HOHO")
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
if anim_name == "StormTimerAppear":
animation.play("StormTimer")
func Storm():
if G.StormTimeLeft <= 0 and stormTimerDamage.is_stopped():
stormTimerDamage.start(1)
func _on_storm_timer_damage_timeout() -> void:
if stormTimerDamage.is_stopped():
stormTimerDamage.start(1)
hit(1)
func pause():
get_parent().pause()
func resume():
get_parent().resume()

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://0duodsosmfpq"]
[gd_scene load_steps=24 format=3 uid="uid://0duodsosmfpq"]
[ext_resource type="PackedScene" uid="uid://b18cf4i8v6a1" path="res://scenes/game/entities/entity.tscn" id="1_kmfws"]
[ext_resource type="Script" path="res://scenes/game/entities/player/player.gd" id="2_s0pfn"]
@ -13,10 +13,186 @@
[ext_resource type="StyleBox" uid="uid://31r7sc1edews" path="res://Theme/Empty.tres" id="7_luccy"]
[ext_resource type="StyleBox" uid="uid://6x7dblrcglcl" path="res://Theme/HealthBar.tres" id="8_kgbvc"]
[ext_resource type="Texture2D" uid="uid://c2o4115sewunm" path="res://Assets/Icons/Roll.png" id="10_1rhoe"]
[ext_resource type="Texture2D" uid="uid://caumye6m8df7a" path="res://Assets/Icons/Storm.png" id="12_7rs7u"]
[ext_resource type="StyleBox" uid="uid://db7h680qdfcrv" path="res://scenes/menu/startMenu/Storm.tres" id="12_wohun"]
[sub_resource type="CircleShape2D" id="CircleShape2D_7ukjs"]
radius = 8.94427
[sub_resource type="Animation" id="Animation_4p2qj"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera2D/CanvasLayer/Control/Storm:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Camera2D/CanvasLayer/Control/Storm:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Camera2D/CanvasLayer/Control/IntroductionLabel:visible_ratio")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Camera2D/CanvasLayer/Control/WARNING:visible_ratio")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Camera2D/CanvasLayer/Control/ColorRect:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_7uqa8"]
resource_name = "StormTimerAppear"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera2D/CanvasLayer/Control/Storm:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Camera2D/CanvasLayer/Control/Storm:scale")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(1, 1)]
}
[sub_resource type="Animation" id="Animation_8ahng"]
resource_name = "StormTimer"
length = 0.8
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera2D/CanvasLayer/Control/Storm:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.4, 0.8),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(1.1, 1.1), Vector2(1, 1)]
}
[sub_resource type="Animation" id="Animation_1uxm1"]
resource_name = "Introduction"
length = 21.0
step = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera2D/CanvasLayer/Control/IntroductionLabel:visible_ratio")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1.5, 4.5, 6),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [0.0, 1.0, 1.0, 0.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Camera2D/CanvasLayer/Control/WARNING:visible_ratio")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(7, 9, 12, 14),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [0.0, 1.0, 1.0, 0.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Camera2D/CanvasLayer/Control/ColorRect:modulate")
tracks/2/interp = 2
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(15, 16.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/3/type = "method"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath(".")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 16.5),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"pause"
}, {
"args": [],
"method": &"resume"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_1cg8p"]
_data = {
"Introduction": SubResource("Animation_1uxm1"),
"RESET": SubResource("Animation_4p2qj"),
"StormTimer": SubResource("Animation_8ahng"),
"StormTimerAppear": SubResource("Animation_7uqa8")
}
[sub_resource type="CircleShape2D" id="CircleShape2D_8u3aq"]
radius = 8.94427
@ -27,6 +203,7 @@ radius = 8.94427
light_mask = 1536
visibility_layer = 1536
collision_layer = 1536
collision_mask = 46
script = ExtResource("2_s0pfn")
[node name="CollisionShape2D" parent="." index="0"]
@ -167,6 +344,101 @@ layout_mode = 2
layout_mode = 2
texture = ExtResource("4_6t857")
[node name="STORMWARNINGLabel" type="Label" parent="Camera2D/CanvasLayer/Control" index="3"]
visible = false
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -0.5
offset_right = 0.5
offset_bottom = 67.0
grow_horizontal = 2
text = "STORMWARNING"
[node name="Storm" type="HBoxContainer" parent="Camera2D/CanvasLayer/Control" index="4"]
visible = false
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -320.0
offset_top = 67.0
offset_right = 320.0
offset_bottom = 152.0
grow_horizontal = 2
pivot_offset = Vector2(320, 42)
[node name="TextureRect" type="TextureRect" parent="Camera2D/CanvasLayer/Control/Storm" index="0"]
layout_mode = 2
texture = ExtResource("12_7rs7u")
expand_mode = 2
[node name="ProgressBar" type="ProgressBar" parent="Camera2D/CanvasLayer/Control/Storm" index="1"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 1
theme_override_styles/background = ExtResource("7_luccy")
theme_override_styles/fill = ExtResource("12_wohun")
show_percentage = false
[node name="AnimationPlayer" type="AnimationPlayer" parent="Camera2D/CanvasLayer/Control" index="5"]
process_mode = 3
root_node = NodePath("../../../..")
libraries = {
"": SubResource("AnimationLibrary_1cg8p")
}
[node name="ColorRect" type="ColorRect" parent="Camera2D/CanvasLayer/Control" index="6"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="WARNING" type="Label" parent="Camera2D/CanvasLayer/Control" index="7"]
process_mode = 3
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -500.0
offset_top = -500.0
offset_right = 500.0
offset_bottom = 500.0
grow_horizontal = 2
grow_vertical = 2
text = "WARNING"
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 3
visible_characters = 0
visible_ratio = 0.0
[node name="IntroductionLabel" type="Label" parent="Camera2D/CanvasLayer/Control" index="8"]
process_mode = 3
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -500.0
offset_top = -500.0
offset_right = 500.0
offset_bottom = 500.0
grow_horizontal = 2
grow_vertical = 2
text = "INTRODUCTION"
horizontal_alignment = 1
vertical_alignment = 1
visible_characters = 0
visible_ratio = 0.0
[node name="RollTimer" type="Timer" parent="." index="3"]
one_shot = true
@ -197,9 +469,13 @@ texture_scale = 2.0
position = Vector2(0, 4)
shape = SubResource("CircleShape2D_bjveg")
[connection signal="death" from="." to="." method="_on_death"]
[node name="StormTimerDamage" type="Timer" parent="." index="9"]
one_shot = true
[connection signal="animation_finished" from="Camera2D/CanvasLayer/Control/AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
[connection signal="timeout" from="RollTimer" to="." method="_on_roll_timeout"]
[connection signal="timeout" from="RollCooldownTimer" to="." method="_on_roll_cooldown_timer_timeout"]
[connection signal="signalHit" from="HitBox" to="." method="_on_hit_box_signal_hit"]
[connection signal="timeout" from="StormTimerDamage" to="." method="_on_storm_timer_damage_timeout"]
[editable path="HitBox"]

View file

@ -4,14 +4,26 @@ extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
randomize()
$Map.spawnObjects()
$Map.spawnEnemies()
stormTimer.start(randi_range(G.GAMETIME.MIN, G.GAMETIME.MAX))
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
G.StormTimeLeft = stormTimer.time_left
func _on_storm_timer_timeout() -> void:
print("Storm")
func _on_player_death() -> void:
get_parent().loadEndScren()
func pause():
get_tree().paused = true
func resume():
get_tree().paused = false

View file

@ -8,11 +8,12 @@
script = ExtResource("1_napbe")
[node name="Player" parent="." instance=ExtResource("3_sjgkj")]
position = Vector2(-24, 0)
position = Vector2(-16, -88)
[node name="Map" parent="." instance=ExtResource("3_vpriv")]
[node name="StormTimer" type="Timer" parent="."]
one_shot = true
[connection signal="death" from="Player" to="." method="_on_player_death"]
[connection signal="timeout" from="StormTimer" to="." method="_on_storm_timer_timeout"]

View file

@ -12,6 +12,9 @@ func _ready() -> void:
enemySpawnersArray[0].enabled = true
enemySpawnersArray[1].enabled = true
enemySpawnersArray[2].enabled = true
enemySpawnersArray[3].enabled = true
enemySpawnersArray[4].enabled = true
#for i in enemySpawnersArray:
#i.enabled = true

File diff suppressed because one or more lines are too long

View file

@ -35,7 +35,7 @@ func pickup(newPlayer):
func drop():
global_position.y += 10
player = null
z_index = 0
z_index = 1
func getWeight():
return weight

View file

@ -1,22 +1,33 @@
[gd_scene load_steps=5 format=3 uid="uid://dxpd1pq7v6ing"]
[gd_scene load_steps=7 format=3 uid="uid://dxpd1pq7v6ing"]
[ext_resource type="Script" path="res://scenes/game/objects/object.gd" id="1_3y27f"]
[ext_resource type="Texture2D" uid="uid://c4h5dodgulduy" path="res://Assets/Icons/Pickup.png" id="2_pqvu2"]
[ext_resource type="Texture2D" uid="uid://83mf84k2pi3m" path="res://Assets/Shadow.png" id="3_hre65"]
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_n7gny"]
light_mode = 2
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_3q7s5"]
light_mode = 2
[sub_resource type="CircleShape2D" id="CircleShape2D_vvfu1"]
radius = 8.0
[node name="Object" type="Area2D" groups=["Object"]]
light_mask = 16
visibility_layer = 16
z_index = 1
material = SubResource("CanvasItemMaterial_n7gny")
collision_layer = 16
collision_mask = 96
script = ExtResource("1_3y27f")
[node name="Shadow" type="Sprite2D" parent="."]
material = SubResource("CanvasItemMaterial_3q7s5")
position = Vector2(2.38419e-07, 2.38419e-07)
scale = Vector2(0.5, 0.5)
texture = ExtResource("3_hre65")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -4)
shape = SubResource("CircleShape2D_vvfu1")

View file

@ -10,8 +10,8 @@ radius = 8.0
value = 100
weight = 40
[node name="CollisionShape2D" parent="." index="0"]
[node name="CollisionShape2D" parent="." index="1"]
shape = SubResource("CircleShape2D_fkh3i")
[node name="Sprite2D" parent="." index="1"]
[node name="Sprite2D" parent="." index="2"]
texture = ExtResource("2_3c460")

View file

@ -10,9 +10,8 @@ radius = 8.0
value = 800
weight = 50
[node name="CollisionShape2D" parent="." index="0"]
[node name="CollisionShape2D" parent="." index="1"]
shape = SubResource("CircleShape2D_772ct")
[node name="Sprite2D" parent="." index="1"]
position = Vector2(0, -8)
[node name="Sprite2D" parent="." index="2"]
texture = ExtResource("2_q4tnr")

View file

@ -9,9 +9,8 @@ radius = 8.0
[node name="Vase" instance=ExtResource("1_fkdlr")]
y_sort_enabled = true
[node name="CollisionShape2D" parent="." index="0"]
[node name="CollisionShape2D" parent="." index="1"]
shape = SubResource("CircleShape2D_pmiic")
[node name="Sprite2D" parent="." index="1"]
position = Vector2(0, -4)
[node name="Sprite2D" parent="." index="2"]
texture = ExtResource("2_vxdei")

View file

@ -1,11 +1,26 @@
extends Node
func _ready() -> void:
loadGame()
loadStartMenu()
func _process(delta: float) -> void:
if G.extracted and get_child(0).name != "EndScreen":
loadEndScren()
func loadGame():
G.resetValues()
for i in get_children():
i.queue_free()
add_child(load("res://scenes/game/mainGame/main_game.tscn").instantiate())
func loadEndScren():
for i in get_children():
i.queue_free()
add_child(load("res://scenes/menu/endScreen/end_screen.tscn").instantiate())
func loadStartMenu():
G.resetValues()
for i in get_children():
i.queue_free()
add_child(load("res://scenes/menu/startMenu/start_menu.tscn").instantiate())

View file

@ -0,0 +1,19 @@
extends Control
@onready var moneyResultLabel = $CenterContainer/VBoxContainer/HBoxContainer/MoneyResult
@onready var healthResultLabel = $CenterContainer/VBoxContainer/HBoxContainer2/HealthResult
@onready var succesLabel = $CenterContainer/VBoxContainer/VBoxContainer/SUCCESLabel
@onready var failureLabel = $CenterContainer/VBoxContainer/VBoxContainer/FAILURELabel
func _ready() -> void:
if G.extracted:
succesLabel.show()
failureLabel.hide()
moneyResultLabel.text = str(G.money)
healthResultLabel.text = str(G.lastHealth)
func _on_home_button_button_up() -> void:
get_parent().loadStartMenu()

View file

@ -0,0 +1,112 @@
[gd_scene load_steps=9 format=3 uid="uid://jga6awfuwsyp"]
[ext_resource type="Theme" uid="uid://cotw1alu4b2ad" path="res://Theme/MainTheme.tres" id="1_iscr2"]
[ext_resource type="Texture2D" uid="uid://drjv0kpcfubr0" path="res://Assets/Icons/Dollar.png" id="2_54fgt"]
[ext_resource type="Script" path="res://scenes/menu/endScreen/end_screen.gd" id="2_wokl6"]
[ext_resource type="Texture2D" uid="uid://b27g8eulkxvyr" path="res://Assets/Icons/Health.png" id="3_n82yp"]
[sub_resource type="LabelSettings" id="LabelSettings_3uh6l"]
font_size = 48
font_color = Color(0.918136, 0.0328273, 0.194379, 1)
outline_size = 5
outline_color = Color(0, 0, 0, 1)
[sub_resource type="LabelSettings" id="LabelSettings_58qpv"]
font_size = 48
font_color = Color(0.0700001, 0.6, 0, 1)
outline_size = 5
outline_color = Color(0, 0, 0, 1)
[sub_resource type="LabelSettings" id="LabelSettings_kocpg"]
font_size = 48
font_color = Color(0, 1, 0.0999999, 1)
outline_size = 5
outline_color = Color(0, 0, 0, 1)
[sub_resource type="LabelSettings" id="LabelSettings_2huu8"]
font_size = 48
font_color = Color(1, 0, 0, 1)
outline_size = 5
outline_color = Color(0, 0, 0, 1)
[node name="EndScreen" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_iscr2")
script = ExtResource("2_wokl6")
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="LabelResults" type="Label" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
text = "RESULT"
horizontal_alignment = 1
[node name="HSeparator3" type="HSeparator" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
[node name="FAILURELabel" type="Label" parent="CenterContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
text = "FAILURE"
label_settings = SubResource("LabelSettings_3uh6l")
[node name="SUCCESLabel" type="Label" parent="CenterContainer/VBoxContainer/VBoxContainer"]
visible = false
layout_mode = 2
text = "SUCCES"
label_settings = SubResource("LabelSettings_58qpv")
[node name="HSeparator2" type="HSeparator" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="CenterContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
texture = ExtResource("2_54fgt")
[node name="MoneyResult" type="Label" parent="CenterContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
label_settings = SubResource("LabelSettings_kocpg")
[node name="HBoxContainer2" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="CenterContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
texture = ExtResource("3_n82yp")
[node name="Health" type="Label" parent="CenterContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
text = "10/"
label_settings = SubResource("LabelSettings_2huu8")
[node name="HealthResult" type="Label" parent="CenterContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
label_settings = SubResource("LabelSettings_2huu8")
[node name="HSeparator" type="HSeparator" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
[node name="HomeButton" type="Button" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Understood"
[connection signal="button_up" from="CenterContainer/VBoxContainer/HomeButton" to="." method="_on_home_button_button_up"]

View file

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://db7h680qdfcrv"]
[resource]
bg_color = Color(0.913183, 0.621028, 0, 1)
border_width_left = 5
border_width_top = 5
border_width_right = 5
border_width_bottom = 5
border_color = Color(0, 0, 0, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
corner_detail = 20

View file

@ -0,0 +1,5 @@
extends Control
func _on_start_button_button_up() -> void:
get_parent().loadGame()

View file

@ -0,0 +1,54 @@
[gd_scene load_steps=5 format=3 uid="uid://ceu62dbrvd31p"]
[ext_resource type="Theme" uid="uid://cotw1alu4b2ad" path="res://Theme/MainTheme.tres" id="1_2eoii"]
[ext_resource type="Script" path="res://scenes/menu/startMenu/start_menu.gd" id="2_y1mcp"]
[ext_resource type="PackedScene" uid="uid://br7eqr6jomsg4" path="res://scenes/game/map/map.tscn" id="3_w2x7d"]
[ext_resource type="Texture2D" uid="uid://b2xbgtcyxvi73" path="res://Assets/Player/Player.png" id="4_0cn2q"]
[node name="StartMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_2eoii")
script = ExtResource("2_y1mcp")
[node name="Map" parent="." instance=ExtResource("3_w2x7d")]
visible = false
position = Vector2(976, 540)
[node name="Sprite2D" type="Sprite2D" parent="."]
visible = false
position = Vector2(960, 456)
scale = Vector2(1.5, 1.5)
texture = ExtResource("4_0cn2q")
hframes = 25
[node name="ColorRect" type="ColorRect" parent="."]
modulate = Color(1, 1, 1, 0.376471)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="StartButton" type="Button" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
text = "PLAY"
[connection signal="button_up" from="CenterContainer/VBoxContainer/StartButton" to="." method="_on_start_button_button_up"]