Skip to content
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

Quick fixes #64

Merged
merged 3 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions mob/fish.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
[ext_resource type="Texture2D" uid="uid://bp2wy7ylpuyg5" path="res://images/Tilemaps/Underwater/fish-dart.png" id="1_c22r4"]
[ext_resource type="Script" path="res://mob/fish.gd" id="1_hbkvj"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_qk57g"]
size = Vector2(31, 14)

[sub_resource type="AtlasTexture" id="AtlasTexture_ueh0u"]
atlas = ExtResource("1_c22r4")
region = Rect2(0, 0, 39, 20)
Expand Down Expand Up @@ -75,16 +72,21 @@ animations = [{
"speed": 5.0
}]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_qk57g"]
size = Vector2(31, 14)

[node name="Fish" type="CharacterBody2D"]
position = Vector2(100, 32)
script = ExtResource("1_hbkvj")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0.5, 1)
shape = SubResource("RectangleShape2D_qk57g")

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_vyh8m")
animation = &"walk_left"
autoplay = "walk_right"

[node name="Area2D" type="Area2D" parent="." groups=["fish"]]

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2(0.5, 1)
shape = SubResource("RectangleShape2D_qk57g")
20 changes: 20 additions & 0 deletions mob/player/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ var isFreezed = false

@onready var hearts_container = $ui_layer/lifebar


var isFreezed = false

var fishes: int = 4

func _physics_process(delta):
if not isFreezed:
# Add the gravity.
Expand Down Expand Up @@ -112,6 +117,20 @@ func _process(_delta):
pass



func _on_area_2d_area_entered(area: Area2D) -> void:
if area.is_in_group("fish"):
var fish = area.get_parent()
fish.queue_free()
fishes-=1;
if fishes == 0:
print("All fishes dead")
var index = 5
var tex = load("res://images/icons/postcard.png")
var bigtex = load("res://images/icons/fish.jpg")
name = "Strand"
Global.inv.items[index] = InvItem.new(name, tex, bigtex)

func _on_static_body_2d_player_damaged() -> void:
get_damage()

Expand All @@ -123,3 +142,4 @@ func get_damage():
hearts_container.update_hearts(GamemodeHandler.health)
print(str(GamemodeHandler.health) + " health remaining.")


17 changes: 15 additions & 2 deletions mob/player/player.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[gd_scene load_steps=70 format=3 uid="uid://egesikv1ec5t"]
[gd_scene load_steps=71 format=3 uid="uid://egesikv1ec5t"]


[ext_resource type="Script" path="res://mob/player/player.gd" id="1_ewrr2"]
[ext_resource type="Texture2D" uid="uid://fo4gnr1iuhmw" path="res://images/cat/Idle.png" id="2_r7fdg"]
Expand Down Expand Up @@ -451,7 +452,10 @@ animations = [{
}]

[sub_resource type="CircleShape2D" id="CircleShape2D_wp36s"]
radius = 7.86111
radius = 8.125

[sub_resource type="CircleShape2D" id="CircleShape2D_s81w3"]
radius = 6.25

[node name="Player" type="CharacterBody2D"]
script = ExtResource("1_ewrr2")
Expand Down Expand Up @@ -500,3 +504,12 @@ offset_top = 80.0
offset_right = 16.0
offset_bottom = 80.0
scale = Vector2(4, 4)

[node name="Area2D" type="Area2D" parent="."]

[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
light_mask = 2
scale = Vector2(2.56, 2.56)
shape = SubResource("CircleShape2D_s81w3")

[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
5 changes: 5 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ window/vsync/vsync_mode=2

enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg", "res://addons/gloot/plugin.cfg", "res://addons/modular-settings-menu/plugin.cfg", "res://addons/quest_system/plugin.cfg")

[global_group]

fish=""
player=""

[gui]

theme/custom_font="res://assets/fonts/base_font.tres"
Expand Down
4 changes: 2 additions & 2 deletions scenes/Underwater.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ sources/0 = SubResource("TileSetAtlasSource_b5ats")
sources/1 = SubResource("TileSetAtlasSource_cv3c4")
sources/2 = SubResource("TileSetAtlasSource_bysp0")

[node name="Node2D" type="Node2D"]
[node name="Node2D2" type="Node2D"]

[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(425.306, 394.684)
Expand All @@ -139,7 +139,7 @@ texture = ExtResource("1_3vnpc")
modulate = Color(0, 0.485494, 0.485645, 1)
position = Vector2(769, 363)

[node name="Player" parent="." instance=ExtResource("8_p7uvn")]
[node name="Player" parent="." groups=["player"] instance=ExtResource("8_p7uvn")]
position = Vector2(359, 73)

[node name="Background" type="TileMapLayer" parent="."]
Expand Down
6 changes: 3 additions & 3 deletions scenes/credits.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ text = "Story"

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
text = "Lukas, Daniel, David & Alex"
text = "Lukas, Daniel, David, Alex & Nico"
horizontal_alignment = 2

[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
Expand All @@ -99,7 +99,7 @@ text = "Game name"

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer3"]
layout_mode = 2
text = "ChatGPT"
text = "Nico & ChatGPT"
horizontal_alignment = 2

[node name="HBoxContainer4" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
Expand Down Expand Up @@ -140,7 +140,7 @@ horizontal_alignment = 3

[node name="Guys" type="Label" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer6"]
layout_mode = 2
text = "Random Plugins & Nico"
text = "Random Plugins, Nico & David"
horizontal_alignment = 2

[node name="HBoxContainer7" type="HBoxContainer" parent="MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer"]
Expand Down