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)