added project with nerabochie cows

This commit is contained in:
arrrtemida
2025-08-22 17:16:22 +05:00
commit 0d3f195aff
147 changed files with 5060 additions and 0 deletions

View File

@ -0,0 +1,28 @@
extends Sprite2D
@onready var hurt_component: HurtComponent = $HurtComponent
@onready var damage_component: DamageComponent = $DamageComponent
var stone_scene = preload("res://scenes/objects/rocks/stone.tscn")
func _ready() -> void:
hurt_component.hurt.connect(on_hurt)
damage_component.max_damaged_reached.connect(on_max_damage_reached)
func on_hurt(hit_damage: int) -> void:
await get_tree().create_timer(0.33).timeout
damage_component.apply_damage(hit_damage)
material.set_shader_parameter("shake_intensity", 0.3)
await get_tree().create_timer(0.5).timeout
material.set_shader_parameter("shake_intensity", 0.0)
func on_max_damage_reached() -> void:
call_deferred("add_stone_scene")
await get_tree().create_timer(0.33).timeout
queue_free()
func add_stone_scene() -> void:
await get_tree().create_timer(0.33).timeout
var stone_instance = stone_scene.instantiate() as Node2D
stone_instance.global_position = global_position
get_parent().add_child(stone_instance)

View File

@ -0,0 +1 @@
uid://ck5yoag6lc7yu

View File

@ -0,0 +1,45 @@
[gd_scene load_steps=10 format=3 uid="uid://bogb8jcyikd22"]
[ext_resource type="Texture2D" uid="uid://djm430uofdey4" path="res://assets/game/Objects/basic_grass_biom_things.png" id="1_70ahf"]
[ext_resource type="Shader" uid="uid://bc6pkfntsjgpa" path="res://scenes/objects/shake.gdshader" id="1_bntui"]
[ext_resource type="PackedScene" uid="uid://c82ghkmm1uxfp" path="res://scenes/components/hurt_component.tscn" id="2_aw33s"]
[ext_resource type="Script" uid="uid://ck5yoag6lc7yu" path="res://scenes/objects/rocks/rock.gd" id="2_f5itc"]
[ext_resource type="PackedScene" uid="uid://cd3awkrirej8q" path="res://scenes/components/damage_component.tscn" id="4_bntui"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8i8v8"]
resource_local_to_scene = true
shader = ExtResource("1_bntui")
shader_parameter/shake_intensity = 0.0
shader_parameter/shake_speed = 20.0
[sub_resource type="AtlasTexture" id="AtlasTexture_aw33s"]
atlas = ExtResource("1_70ahf")
region = Rect2(128, 16, 16, 16)
[sub_resource type="CircleShape2D" id="CircleShape2D_70ahf"]
radius = 5.0
[sub_resource type="CircleShape2D" id="CircleShape2D_aw33s"]
radius = 6.0
[node name="Rock" type="Sprite2D"]
material = SubResource("ShaderMaterial_8i8v8")
position = Vector2(0, -4)
texture = SubResource("AtlasTexture_aw33s")
script = ExtResource("2_f5itc")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(0, 1)
shape = SubResource("CircleShape2D_70ahf")
[node name="HurtComponent" parent="." instance=ExtResource("2_aw33s")]
tool = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="HurtComponent"]
shape = SubResource("CircleShape2D_aw33s")
debug_color = Color(0.84073, 0.29711, 0.6188, 0.42)
[node name="DamageComponent" parent="." instance=ExtResource("4_bntui")]
max_damage = 4

View File

@ -0,0 +1,21 @@
[gd_scene load_steps=5 format=3 uid="uid://e1k1nplcm5x3"]
[ext_resource type="Texture2D" uid="uid://djm430uofdey4" path="res://assets/game/Objects/basic_grass_biom_things.png" id="1_oca81"]
[ext_resource type="PackedScene" uid="uid://dk2en4pak8e6f" path="res://scenes/components/collectable_component.tscn" id="2_k7uky"]
[sub_resource type="AtlasTexture" id="AtlasTexture_dgxlj"]
atlas = ExtResource("1_oca81")
region = Rect2(114, 18, 10, 8)
[sub_resource type="CircleShape2D" id="CircleShape2D_oca81"]
radius = 3.0
[node name="Stone" type="Sprite2D"]
texture = SubResource("AtlasTexture_dgxlj")
[node name="CollectableComponent" parent="." instance=ExtResource("2_k7uky")]
collectable_name = "stone"
[node name="CollisionShape2D" type="CollisionShape2D" parent="CollectableComponent"]
shape = SubResource("CircleShape2D_oca81")
debug_color = Color(0, 0.64226, 0.32076, 0.42)

View File

@ -0,0 +1,16 @@
shader_type canvas_item;
uniform float shake_intensity = 0.0;
uniform float shake_speed = 20.0;
void vertex()
{
vec2 shake = vec2(0.0);
if (VERTEX.y < 0.0)
{
shake.x = sin(TIME * shake_speed + VERTEX.y) * shake_intensity;
}
VERTEX.xy += shake;
}

View File

@ -0,0 +1 @@
uid://bc6pkfntsjgpa

View File

@ -0,0 +1,46 @@
[gd_scene load_steps=10 format=3 uid="uid://b1ecwl06mird5"]
[ext_resource type="Shader" uid="uid://bc6pkfntsjgpa" path="res://scenes/objects/shake.gdshader" id="1_f4wgc"]
[ext_resource type="Texture2D" uid="uid://djm430uofdey4" path="res://assets/game/Objects/basic_grass_biom_things.png" id="1_lwbpo"]
[ext_resource type="Script" uid="uid://bjyo5al8rswf6" path="res://scenes/objects/trees/tree.gd" id="2_wjqkr"]
[ext_resource type="PackedScene" uid="uid://cd3awkrirej8q" path="res://scenes/components/damage_component.tscn" id="3_ivetc"]
[ext_resource type="PackedScene" uid="uid://c82ghkmm1uxfp" path="res://scenes/components/hurt_component.tscn" id="4_wjqkr"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_6vpey"]
resource_local_to_scene = true
shader = ExtResource("1_f4wgc")
shader_parameter/shake_intensity = 0.0
shader_parameter/shake_speed = 20.0
[sub_resource type="AtlasTexture" id="AtlasTexture_sx6ol"]
atlas = ExtResource("1_lwbpo")
region = Rect2(16, 0, 32, 32)
[sub_resource type="CircleShape2D" id="CircleShape2D_ivetc"]
radius = 4.12311
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f4wgc"]
size = Vector2(8, 10)
[node name="LargeTree" type="Sprite2D"]
material = SubResource("ShaderMaterial_6vpey")
position = Vector2(0, -14)
texture = SubResource("AtlasTexture_sx6ol")
script = ExtResource("2_wjqkr")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(0, 11)
shape = SubResource("CircleShape2D_ivetc")
[node name="HurtComponent" parent="." instance=ExtResource("4_wjqkr")]
tool = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="HurtComponent"]
position = Vector2(0, 10)
shape = SubResource("RectangleShape2D_f4wgc")
debug_color = Color(0.987551, 0, 0.311789, 0.42)
[node name="DamageComponent" parent="." instance=ExtResource("3_ivetc")]
max_damage = 6

View File

@ -0,0 +1,21 @@
[gd_scene load_steps=5 format=3 uid="uid://dwuetj48nbxl4"]
[ext_resource type="Texture2D" uid="uid://djm430uofdey4" path="res://assets/game/Objects/basic_grass_biom_things.png" id="1_bcctm"]
[ext_resource type="PackedScene" uid="uid://dk2en4pak8e6f" path="res://scenes/components/collectable_component.tscn" id="2_e2a05"]
[sub_resource type="AtlasTexture" id="AtlasTexture_e2a05"]
atlas = ExtResource("1_bcctm")
region = Rect2(80, 32, 16, 16)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_s5rqd"]
size = Vector2(12, 9)
[node name="Log" type="Sprite2D"]
texture = SubResource("AtlasTexture_e2a05")
[node name="CollectableComponent" parent="." instance=ExtResource("2_e2a05")]
collectable_name = "Log"
[node name="CollisionShape2D" type="CollisionShape2D" parent="CollectableComponent"]
position = Vector2(0, 0.5)
shape = SubResource("RectangleShape2D_s5rqd")

View File

@ -0,0 +1,46 @@
[gd_scene load_steps=10 format=3 uid="uid://l1macsaei2qb"]
[ext_resource type="Texture2D" uid="uid://djm430uofdey4" path="res://assets/game/Objects/basic_grass_biom_things.png" id="1_a8qts"]
[ext_resource type="Shader" uid="uid://bc6pkfntsjgpa" path="res://scenes/objects/shake.gdshader" id="1_w057i"]
[ext_resource type="Script" uid="uid://bjyo5al8rswf6" path="res://scenes/objects/trees/tree.gd" id="2_g5iuu"]
[ext_resource type="PackedScene" uid="uid://c82ghkmm1uxfp" path="res://scenes/components/hurt_component.tscn" id="2_xyb6m"]
[ext_resource type="PackedScene" uid="uid://cd3awkrirej8q" path="res://scenes/components/damage_component.tscn" id="3_au4vd"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_skbjc"]
resource_local_to_scene = true
shader = ExtResource("1_w057i")
shader_parameter/shake_intensity = 0.0
shader_parameter/shake_speed = 20.0
[sub_resource type="AtlasTexture" id="AtlasTexture_xyb6m"]
atlas = ExtResource("1_a8qts")
region = Rect2(0, 0, 16, 32)
[sub_resource type="CircleShape2D" id="CircleShape2D_au4vd"]
radius = 4.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_au4vd"]
size = Vector2(8, 9)
[node name="SmallTree" type="Sprite2D"]
material = SubResource("ShaderMaterial_skbjc")
position = Vector2(0, -10)
texture = SubResource("AtlasTexture_xyb6m")
script = ExtResource("2_g5iuu")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(0, 8)
shape = SubResource("CircleShape2D_au4vd")
[node name="HurtComponent" parent="." instance=ExtResource("2_xyb6m")]
tool = 1
[node name="HurtComponentCollisionShape2D" type="CollisionShape2D" parent="HurtComponent"]
position = Vector2(0, 7.5)
shape = SubResource("RectangleShape2D_au4vd")
debug_color = Color(0.86184, 0.231398, 0.689692, 0.42)
[node name="DamageComponent" parent="." instance=ExtResource("3_au4vd")]
max_damage = 3

View File

@ -0,0 +1,28 @@
extends Sprite2D
@onready var hurt_component: HurtComponent = $HurtComponent
@onready var damage_component: DamageComponent = $DamageComponent
var log_scene = preload("res://scenes/objects/trees/log.tscn")
func _ready() -> void:
hurt_component.hurt.connect(on_hurt)
damage_component.max_damaged_reached.connect(on_max_damage_reached)
func on_hurt(hit_damage: int) -> void:
await get_tree().create_timer(0.33).timeout
damage_component.apply_damage(hit_damage)
material.set_shader_parameter("shake_intensity", 0.5)
await get_tree().create_timer(1.0).timeout
material.set_shader_parameter("shake_intensity", 0.0)
func on_max_damage_reached() -> void:
call_deferred("add_log_scene")
await get_tree().create_timer(0.33).timeout
queue_free()
func add_log_scene() -> void:
await get_tree().create_timer(0.33).timeout
var log_instance = log_scene.instantiate() as Node2D
log_instance.global_position = global_position
get_parent().add_child(log_instance)

View File

@ -0,0 +1 @@
uid://bjyo5al8rswf6