Diversified field shapes

feature/fight_system
kziolkowski 6 months ago
parent e8a58655ad
commit 2f5296e05a

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgmu3qlovdr22"
path="res://.godot/imported/field_outline_1.png-6d3fddc82592de77807ed60581b515c5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/masks/field_outline_1.png"
dest_files=["res://.godot/imported/field_outline_1.png-6d3fddc82592de77807ed60581b515c5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://eg5ej0mtuac"
path="res://.godot/imported/field_outline_2.png-e3ddb80217ba93d880ff746f003587ee.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/masks/field_outline_2.png"
dest_files=["res://.godot/imported/field_outline_2.png-e3ddb80217ba93d880ff746f003587ee.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://djpigvoyadvjs"
path="res://.godot/imported/field_outline_3.png-1ae7ea2c620df01f38d55e21a86cbf92.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/masks/field_outline_3.png"
dest_files=["res://.godot/imported/field_outline_3.png-1ae7ea2c620df01f38d55e21a86cbf92.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
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

@ -1,10 +1,13 @@
[gd_scene load_steps=8 format=3 uid="uid://b1d2e7ely6hyw"]
[gd_scene load_steps=11 format=3 uid="uid://b1d2e7ely6hyw"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="1_femni"]
[ext_resource type="Script" uid="uid://bdffon388rkty" path="res://scripts/CSharp/Common/Farming/FieldBehaviour2D.cs" id="2_femni"]
[ext_resource type="Texture2D" uid="uid://cpxjptdjw7bi6" path="res://art/farm/tilable grounds/böden/trockene farming erde rund.png" id="2_yi42k"]
[ext_resource type="Texture2D" uid="uid://d3dq15edmgbwf" path="res://art/farm/tilable grounds/böden/nasse farming erde rund.png" id="4_lsfck"]
[ext_resource type="Texture2D" uid="uid://cgmu3qlovdr22" path="res://art/masks/field_outline_1.png" id="3_cus02"]
[ext_resource type="Texture2D" uid="uid://eg5ej0mtuac" path="res://art/masks/field_outline_2.png" id="4_msuq8"]
[ext_resource type="Texture2D" uid="uid://djpigvoyadvjs" path="res://art/masks/field_outline_3.png" id="5_21et0"]
[ext_resource type="PackedScene" uid="uid://c3hwbwo423nbm" path="res://prefabs/farm/base_plant_2d.tscn" id="5_femni"]
[ext_resource type="Texture2D" uid="uid://c2pirgay3jfnn" path="res://art/farm/tilable grounds/böden/trockene farming erde.png" id="6_4k6eh"]
[ext_resource type="Texture2D" uid="uid://ctvdxwgmfaj5c" path="res://art/farm/tilable grounds/böden/nasse farming erde.png" id="7_rrmd3"]
[sub_resource type="CircleShape2D" id="CircleShape2D_yi42k"]
resource_local_to_scene = true
@ -21,13 +24,15 @@ visible = false
z_index = 1
scale = Vector2(2.225, 2.225)
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_growingCollider")]
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "_growingCollider")]
z_index = -1
scale = Vector2(0.9, 1)
texture = ExtResource("2_yi42k")
script = ExtResource("2_femni")
Tilled = ExtResource("2_yi42k")
Watered = ExtResource("4_lsfck")
_fieldSprite = NodePath("MaskedField/FieldTexture")
_maskSprite = NodePath("MaskedField")
_maskTexture = Array[Texture2D]([ExtResource("3_cus02"), ExtResource("4_msuq8"), ExtResource("5_21et0")])
Tilled = ExtResource("6_4k6eh")
Watered = ExtResource("7_rrmd3")
_growingCollider = NodePath("BasePlant/InteractionArea")
[node name="BasePlant" parent="FieldBehaviour" node_paths=PackedStringArray("_field") instance=ExtResource("5_femni")]
@ -45,12 +50,17 @@ shape = SubResource("CircleShape2D_yi42k")
[node name="CollisionShape3D" parent="FieldBehaviour/BasePlant/ReadyPlantInventoryItem/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_femni")
[node name="Label" parent="FieldBehaviour/BasePlant/ReadyPlantInventoryItem/InteractionArea2" index="1"]
visible = false
[node name="ReadyPlant" parent="FieldBehaviour/BasePlant/ReadyPlantInventoryItem" index="5"]
position = Vector2(0, -291.3)
[node name="MaskedField" type="Sprite2D" parent="FieldBehaviour"]
clip_children = 1
scale = Vector2(1.5, 1.5)
texture = ExtResource("4_msuq8")
[node name="FieldTexture" type="Sprite2D" parent="FieldBehaviour/MaskedField"]
texture = ExtResource("6_4k6eh")
[connection signal="Interacted" from="InteractionArea2" to="FieldBehaviour/BasePlant" method="Grow"]
[editable path="FieldBehaviour/BasePlant"]

@ -1,3 +1,4 @@
using System;
using Babushka.scripts.CSharp.Common.CharacterControls;
using Godot;
@ -15,6 +16,9 @@ public enum FieldState
[GlobalClass]
public partial class FieldBehaviour2D : Sprite2D
{
[Export] private Sprite2D _fieldSprite;
[Export] private Sprite2D _maskSprite;
[Export] private Texture2D[] _maskTexture;
[Export] private Texture2D Tilled;
[Export] private Texture2D Watered;
[Export] public FieldState FieldState = FieldState.Tilled;
@ -25,6 +29,8 @@ public partial class FieldBehaviour2D : Sprite2D
public override void _Ready()
{
UpdateFieldState(FieldState);
int randomIndex = new Random().Next(0, _maskTexture.Length);
_maskSprite.Texture = _maskTexture[randomIndex];
base._Ready();
}
@ -37,12 +43,12 @@ public partial class FieldBehaviour2D : Sprite2D
break;
case FieldState.Tilled:
FieldState = FieldState.Tilled;
Texture = Tilled;
_fieldSprite.Texture = Tilled;
_growingCollider.Visible = false;
break;
case FieldState.Watered:
FieldState = FieldState.Watered;
Texture = Watered;
_fieldSprite.Texture = Watered;
_growingCollider.Visible = true;
break;
case FieldState.Planted:
@ -58,7 +64,7 @@ public partial class FieldBehaviour2D : Sprite2D
public void Water()
{
FieldState = FieldState.Watered;
Texture = Watered;
_fieldSprite.Texture = Watered;
}
/// <summary>
@ -69,7 +75,7 @@ public partial class FieldBehaviour2D : Sprite2D
switch (FieldState)
{
case FieldState.Empty:
Texture = Tilled;
_fieldSprite.Texture = Tilled;
FieldState = FieldState.Tilled;
break;
case FieldState.Watered:

Loading…
Cancel
Save