Compare commits

..

14 Commits

Author SHA1 Message Date
jlink a2ef3bfaf0 Window angepasst 2025-12-18 13:02:32 +01:00
jlink 1ab1071246 HoverIndicator off 2025-12-17 15:29:58 +01:00
jlink 09f55d3aa7 BlobFighter TargetSelection ColliderShape2D Transform angepasst 2025-12-10 15:29:56 +01:00
Jonathan 0434667c22 Merge pull request 'feature/bugfixes_And_Polish' (#39) from feature/bugfixes_And_Polish into develop
Reviewed-on: #39
Reviewed-by: Jonathan <cblech@ymail.com>
2025-12-09 15:20:36 +01:00
kziolkowski e51e0a24d2 🐛 fixed dialogic bugs and moved trash items out of the way 2025-12-06 21:46:54 +01:00
kziolkowski 7bb523f9e7 🐛 harvested plants don't come back on scene reload 2025-12-06 20:47:56 +01:00
kziolkowski a3651d6268 deleted unused code 2025-12-06 20:40:47 +01:00
kziolkowski 0892a13e66 🐛 fixed beet harvesting 2025-12-06 20:36:22 +01:00
kziolkowski 61caa6eea6 Merge branch 'refs/heads/develop' into feature/bugfixes_And_Polish 2025-12-06 19:59:31 +01:00
kziolkowski 2ec693eed2 Merge pull request 'Added visual feedback when hitting a region in the minigame' (#37) from minigame_hit_feedback into develop
Reviewed-on: #37
Reviewed-by: kziolkowski <katharina.ziolkowski@gmail.com>
2025-12-06 19:54:11 +01:00
kziolkowski b7d1f9d8d5 Merge branch 'develop' into minigame_hit_feedback 2025-12-06 19:54:05 +01:00
kziolkowski 12bf632932 Merge pull request 'Added randomnes into attack minigame' (#36) from minigame_variation into develop
Reviewed-on: #36
Reviewed-by: kziolkowski <katharina.ziolkowski@gmail.com>
2025-12-06 19:53:49 +01:00
kziolkowski 996470f5e6 🐛 fixed beets double spawning bug 2025-12-04 23:45:35 +01:00
jonathan aa4f1c55b5 Added visual feedback when hitting a region in the minigame 2025-12-04 21:18:47 +01:00
17 changed files with 125 additions and 2336 deletions
@@ -3,19 +3,20 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ccrnmx6bd842k"
path="res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.ctex"
path.s3tc="res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://art/characters/farm fäulnis blobs.png"
dest_files=["res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.ctex"]
dest_files=["res://.godot/imported/farm fäulnis blobs.png-afe542d3466e5ab2e79933f2f163e667.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,4 +38,4 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
detect_3d/compress_to=0
+1
View File
@@ -12,3 +12,4 @@ ifquest res://resources/quests/demo/2_collect_ducks.tres, 1:
Yeli: Have you collected all the ducks yet?
[end_timeline]
Yeli doesn't seem to have anything to say...
[end_timeline]
+6 -3
View File
@@ -53,7 +53,7 @@
[sub_resource type="CircleShape2D" id="CircleShape2D_at1n1"]
resource_local_to_scene = true
radius = 500.0
radius = 300.0
[sub_resource type="SpriteFrames" id="SpriteFrames_f6hss"]
animations = [{
@@ -205,6 +205,7 @@ z_index = 1
y_sort_enabled = true
script = ExtResource("1_hn8at")
_sprite = NodePath("TalkingControl/AnimatedSprite")
_retriggerSameTimeline = true
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("42_ahrat")]
position = Vector2(0, -450)
@@ -244,9 +245,11 @@ stream = SubResource("AudioStreamRandomizer_ngji7")
bus = &"SFX"
script = ExtResource("50_a7v1a")
[connection signal="FinishedTalking" from="." to="InteractionArea" method="SetActiveInverse"]
[connection signal="Talking" from="." to="Dialogic starter" method="open"]
[connection signal="Interacted" from="InteractionArea" to="." method="ToggleTalking"]
[connection signal="Interacted" from="InteractionArea" to="." method="StartTalking"]
[connection signal="Interacted" from="InteractionArea" to="InteractionArea" method="ToggleActive"]
[connection signal="timelineEnded" from="Dialogic starter" to="." method="StopTalking"]
[connection signal="timelineEnded" from="Dialogic starter" to="InteractionArea" method="ToggleActive"]
[connection signal="timelineEnded" from="DialogicToggle" to="." method="ToggleTalking"]
[connection signal="timelineStarted" from="DialogicToggle" to="SFX/AudioStreamPlayer" method="PlayOneShot"]
+1
View File
@@ -215,6 +215,7 @@ Payload = 3
[connection signal="Interacted" from="GrowingInteractionArea" to="." method="Grow"]
[connection signal="SuccessfulPickUp" from="ReadyPlantInventoryItem" to="." method="queue_free"]
[connection signal="Interacted" from="ReadyPlantInventoryItem/PickupInteractionArea" to="." method="Harvest"]
[editable path="GrowingInteractionArea"]
[editable path="ReadyPlantInventoryItem"]
-3
View File
@@ -48,9 +48,6 @@ shape = SubResource("CircleShape2D_hiixr")
[node name="SpawnWithItem" parent="ReadyPlantInventoryItem" index="0"]
_blueprint = ExtResource("3_agmuy")
[node name="PickupInteractionArea" parent="ReadyPlantInventoryItem" index="3"]
_active = false
[node name="CollisionShape3D" parent="ReadyPlantInventoryItem/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_ae08q")
@@ -14,5 +14,9 @@ position = Vector2(23, -96)
scale = Vector2(0.547474, 0.547474)
texture = SubResource("AtlasTexture_ane0o")
[node name="CollisionShape2D" parent="TargetSelection/Click" index="0"]
position = Vector2(25.215, -195)
scale = Vector2(0.72370636, 1)
[node name="Sprite2D" parent="TargetSelection/HoverIndicator" index="0"]
position = Vector2(1, -126)
position = Vector2(0.84, -126)
+2 -2
View File
@@ -186,8 +186,8 @@ directories/tres_directory={
[display]
window/size/viewport_width=1980
window/size/viewport_height=1020
window/size/viewport_width=1920
window/size/viewport_height=1080
window/stretch/mode="viewport"
window/stretch/aspect="keep_height"
+1 -1
View File
@@ -1030,7 +1030,6 @@ y_sort_enabled = true
[node name="Yeli" parent="YSorted" instance=ExtResource("24_wtdui")]
position = Vector2(6403, 3362)
_timelinesToPlay = PackedStringArray("yeli_quest_select")
_retriggerSameTimeline = true
[node name="Vesna" parent="YSorted" instance=ExtResource("1_7wfwe")]
z_index = 1
@@ -2375,6 +2374,7 @@ position = Vector2(-5016, 3361)
visible = false
z_index = 1
y_sort_enabled = true
position = Vector2(-204, -5186)
[node name="trashObject" parent="YSorted/trash" instance=ExtResource("53_ycj14")]
z_index = 0
File diff suppressed because it is too large Load Diff
@@ -223,6 +223,7 @@ _sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_vesnas
[node name="Foreground" type="Node" parent="."]
[node name="Table" type="Sprite2D" parent="Foreground"]
z_index = 2
y_sort_enabled = true
position = Vector2(-1888, 1112)
texture = ExtResource("2_ubg3a")
@@ -231,6 +232,7 @@ region_enabled = true
region_rect = Rect2(1012, 1743, 1470, 417)
[node name="Chair" type="Sprite2D" parent="Foreground"]
z_index = 3
y_sort_enabled = true
position = Vector2(-3032, 2096)
texture = ExtResource("3_gpagp")
+8
View File
@@ -1760,6 +1760,7 @@ metadata/SaveID = "7a8210bf-479d-4b4c-9758-98d23e59d5d7"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
_daysWatered = 6
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField" index="7"]
visible = false
@@ -1780,6 +1781,7 @@ metadata/SaveID = "a1d8a0a2-c51c-4410-83c3-0edb31cbf2de"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField2/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
_daysWatered = 6
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField2" index="7"]
visible = false
@@ -1800,6 +1802,7 @@ metadata/SaveID = "79a65532-cb2b-4268-8eb0-8c41a3935cbb"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField3/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
_daysWatered = 5
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField3" index="7"]
visible = false
@@ -1821,6 +1824,7 @@ metadata/SaveID = "13fa64a3-01dc-4fd8-822e-0839c0da3163"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField4/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
_daysWatered = 7
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField4" index="7"]
visible = false
@@ -1842,6 +1846,7 @@ metadata/SaveID = "414ecdb9-f3c4-4fb9-81bd-6ca575784f78"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField5/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
_daysWatered = 6
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField5" index="7"]
visible = false
@@ -1863,6 +1868,7 @@ metadata/SaveID = "b235febb-b231-4f8c-94e9-1f9d9f115b08"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField6/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 1
_field = NodePath("../..")
_daysWatered = 5
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField6" index="7"]
visible = false
@@ -1884,6 +1890,7 @@ metadata/SaveID = "9ccdba91-812a-4c13-9ee0-12472e174fc9"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField7/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
_daysWatered = 6
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField7" index="7"]
visible = false
@@ -1905,6 +1912,7 @@ metadata/SaveID = "da44e54a-0b76-4888-ad8b-782a9d146fa3"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField8/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
_daysWatered = 6
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField8" index="7"]
visible = false
@@ -204,6 +204,12 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
_currentPlant.Field = this;
}
}
public void HarvestPlant()
{
_currentPlant = null;
UpdateFieldState(FieldState.Empty, true);
}
#region SAVE AND LOAD
@@ -243,6 +249,9 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
string id = _saveIdHolder.GetMeta("SaveID").AsString();
Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
// if we already have a plant, don't instantiate another one
int plantCount = PlantingPlaceholder.GetChildCount();
if (save.Count > 0)
{
@@ -253,12 +262,16 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
if (plantDataDict.TryGetValue("prefab_path", out Variant prefabPathVar))
{
InstantiatePlant(prefabPathVar.AsString());
if(plantCount == 0)
InstantiatePlant(prefabPathVar.AsString());
else
_currentPlant = PlantingPlaceholder.GetChild(0) as PlantBehaviour2D;
}
else
{
return;
}
if (plantDataDict.TryGetValue("plant_start_day", out Variant plantStartDay) && _currentPlant != null)
{
_currentPlant.DayPlanted = plantStartDay.AsInt32();
@@ -27,6 +27,7 @@ public partial class PlantBehaviour2D : Node2D
[ExportGroup("PlantConfig")]
[Export] private string _prefabPath;
[Export] private VariableNode _lifecycle;
[Export] private int _daysWatered;
private string _magicWordDialogicEventName = "MagicWord";
private Sprite2D? _currentPlantSprite = null;
@@ -34,7 +35,6 @@ public partial class PlantBehaviour2D : Node2D
private bool _calledOnReady = false;
private int _dayPlanted;
private int _currentDay;
private int _daysWatered;
public PlantState State
{
@@ -160,14 +160,14 @@ public partial class PlantBehaviour2D : Node2D
_currentPlantSprite.Visible = false;
_currentPlantSprite = GetRandomSprite(_readyPlants);
_currentPlantSprite.Visible = true;
ActivatePickupAfterDelay(true);
SetActiveHarvestablePlant(true);
break;
case PlantState.Ready:
_state = PlantState.None;
if(_currentPlantSprite != null)
_currentPlantSprite.Visible = false;
_currentPlantSprite = null;
ActivatePickupAfterDelay(false);
SetActiveHarvestablePlant(false);
break;
default:
break;
@@ -184,12 +184,6 @@ public partial class PlantBehaviour2D : Node2D
return sprites[rand.Next(sprites.Length)];
}
public async void ActivatePickupAfterDelay(bool activate)
{
await ToSignal(GetTree().CreateTimer(1.0f), "timeout");
SetActiveHarvestablePlant(activate);
}
private void SetActiveHarvestablePlant(bool active)
{
_harvestablePlant.IsActive = active;
@@ -206,4 +200,9 @@ public partial class PlantBehaviour2D : Node2D
_magicWordSaid = true;
Grow();
}
public void Harvest()
{
Field.HarvestPlant();
}
}
@@ -21,7 +21,7 @@ public partial class MinigameController : Node2D
God,
VeryGood
}
public class Builder<T>
{
internal class Region
@@ -108,6 +108,8 @@ public partial class MinigameController : Node2D
[Signal] public delegate void ArmMovedEventHandler(float newPos);
[Signal] public delegate void RegionHitEventHandler(int regionIndex);
public override void _EnterTree()
{
HideMinigame();
@@ -125,6 +127,7 @@ public partial class MinigameController : Node2D
ShowMinigame();
Setup(builder);
await _minigameComplete!.Task;
await ToSignal(GetTree().CreateTimer(.3), "timeout");
var returnValue = _hits!.Select(h => builder.regions[h].value).ToList();
Reset();
HideMinigame();
@@ -145,6 +148,7 @@ public partial class MinigameController : Node2D
}
_hits.Add(i);
EmitSignalRegionHit(i);
_armSpeed = -_armSpeed;
@@ -174,16 +178,18 @@ public partial class MinigameController : Node2D
// spawn regions
var regionSum = 0f;
foreach (var region in builder.regions)
foreach (var (region, i) in builder.regions.Select((region, i) => (region, i)))
{
var regionVisual = _regionVisualPrefab.Instantiate<RegionVisual>();
_regionsParent.AddChild(regionVisual);
RegionHit += regionVisual.HitAnimation;
var normalisedAngleStart = regionSum / totalRegionProportion;
var normalisedAngleEnd = (regionSum + region.proportion) / totalRegionProportion;
var normalAngles = new Vector2(normalisedAngleStart, normalisedAngleEnd);
regionVisual.Setup(normalAngles, _baseRegionColor.RandomHue(), region.text, region.theme);
regionVisual.Setup(normalAngles, region.text, region.theme, i);
regionSum += region.proportion;
@@ -207,6 +213,13 @@ public partial class MinigameController : Node2D
{
_minigameComplete = null;
_hits = null;
_regionsParent.GetChildren().ForEach(c => c.QueueFree());
_regionsParent.GetChildren().ForEach(c =>
{
if (c is RegionVisual rv)
{
RegionHit -= rv.HitAnimation;
}
c.QueueFree();
});
}
}
+22 -7
View File
@@ -1,27 +1,42 @@
using Godot;
using System;
using Babushka.scripts.CSharp.Common.Minigame;
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Minigame;
public partial class RegionVisual : Node
{
[Export] private Sprite2D _sliceSprite;
[Export] private Label _textLabel;
[Export] private Node2D _labelPivot;
[Export] private Sprite2D _sliceSprite = null!;
[Export] private Label _textLabel = null!;
[Export] private Node2D _labelPivot = null!;
[Export(PropertyHint.DictionaryType)] private Dictionary<MinigameController.RegionTheme, Color> _fillColors = new();
public void Setup(Vector2 normalAngles, Color color, string regionText, MinigameController.RegionTheme regionTheme)
private int _index;
public void Setup(Vector2 normalAngles, string regionText, MinigameController.RegionTheme regionTheme, int index)
{
var mat = (_sliceSprite.Material as ShaderMaterial)!;
mat.SetShaderParameter("angles", normalAngles);
mat.SetShaderParameter("fillColor", GetFillColor(regionTheme));
var averageAngleRadians = (normalAngles.X + normalAngles.Y) * float.Pi; // '/ 2' from the average and '* 2' from the radians cancel out
// '/ 2' from the average and '* 2' from the radians cancel out
var averageAngleRadians = (normalAngles.X + normalAngles.Y) * float.Pi;
_labelPivot.Rotation = averageAngleRadians;
_textLabel.Rotation = -averageAngleRadians;
_textLabel.Text = regionText;
_index = index;
}
public void HitAnimation(int regionIndex)
{
if(regionIndex != _index) return;
var tween = GetTree().CreateTween();
tween.TweenProperty(_sliceSprite, "scale", new Vector2(1.5f, 1.5f), 0.1f);
tween.TweenProperty(_sliceSprite, "scale", new Vector2(1f, 1f), 0.2f);
}
private Color GetFillColor(MinigameController.RegionTheme theme)
+18 -26
View File
@@ -1,3 +1,4 @@
using Babushka.scripts.CSharp.Common.Services;
using Godot;
namespace Babushka.scripts.CSharp.Common.NPC;
@@ -7,38 +8,29 @@ public partial class TalkingCharacter : Node2D
[Export] private AnimatedSprite2D? _sprite;
[Export] private string[] _timelinesToPlay;
[Export] private bool _retriggerSameTimeline = false;
private bool _isTalking = true;
private int _timelineIndex = 0;
[Signal] public delegate void TalkingEventHandler(string timelineName);
[Signal] public delegate void FinishedTalkingEventHandler(bool hasTimeLinesToPlay);
public override void _Ready()
{
ToggleTalking();
}
public void ToggleTalking()
public void StartTalking()
{
if (_isTalking || _timelineIndex >= _timelinesToPlay.Length)
{
if (_sprite != null)
_sprite.Animation = "idle";
_isTalking = false;
}
else
{
if (_sprite != null)
_sprite.Animation = "talk";
_isTalking = true;
EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]);
if (!_retriggerSameTimeline)
_timelineIndex++;
}
if (_sprite != null)
_sprite.Animation = "talk";
EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]);
if (!_retriggerSameTimeline)
_timelineIndex++;
InputService.Instance.InputEnabled = false;
if (_sprite != null)
_sprite.Play();
}
public void StopTalking()
{
if (_sprite != null)
_sprite.Animation = "idle";
InputService.Instance.InputEnabled = true;
if (_sprite != null)
_sprite.Play();
EmitSignal(SignalName.FinishedTalking, _timelineIndex >= _timelinesToPlay.Length);
}
}
+13
View File
@@ -1,5 +1,18 @@
extends Node
class_name DialogicStarter
signal timelineStarted
signal timelineEnded
func _ready() -> void:
Dialogic.timeline_ended.connect(_on_timeline_ended)
Dialogic.timeline_started.connect(_start_dialog)
func open(timeline: String):
Dialogic.start(timeline)
func _start_dialog() -> void:
timelineStarted.emit()
func _on_timeline_ended() -> void:
timelineEnded.emit()