Fire effect and ice effect

This commit is contained in:
2025-03-01 20:30:35 +01:00
parent a9f8fb717e
commit 9054777a05
7 changed files with 220 additions and 3 deletions

View File

@@ -10,7 +10,7 @@
[ext_resource type="Script" path="res://scripts/components/player_death.gd" id="8_1v23d"]
[ext_resource type="Script" path="res://scripts/components/knockback.gd" id="9_rjyu4"]
[ext_resource type="Script" path="res://scripts/components/brick_throw.gd" id="10_u0v3b"]
[ext_resource type="PackedScene" uid="uid://bymro4t7angv5" path="res://objects/brick.tscn" id="11_qutq2"]
[ext_resource type="PackedScene" uid="uid://bcmx07k12gcsc" path="res://objects/ice_brick.tscn" id="11_ktjj0"]
[ext_resource type="Script" path="res://scripts/components/stomp_damage_component.gd" id="12_payr4"]
[ext_resource type="Script" path="res://scripts/components/flashing_component.gd" id="13_hrtyn"]
[ext_resource type="Script" path="res://scripts/components/invulnerability_component.gd" id="14_jopig"]
@@ -84,7 +84,7 @@ knockback_force = 1500.0
[node name="BrickThrowComponent" type="Node" parent="." node_paths=PackedStringArray("player_controller", "timer")]
script = ExtResource("10_u0v3b")
brick_scene = ExtResource("11_qutq2")
brick_scene = ExtResource("11_ktjj0")
fire_rate = 0.3
player_controller = NodePath("..")
timer = NodePath("../ThrowTimer")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://bwdlmualj6xbw"]
[gd_scene load_steps=15 format=3 uid="uid://bwdlmualj6xbw"]
[ext_resource type="Shader" uid="uid://bs4xvm4qkurpr" path="res://shaders/hit_flash.tres" id="1_ep4yr"]
[ext_resource type="Texture2D" uid="uid://xes6mt2dd5gu" path="res://sprites/robot_cutout.png" id="1_uh38l"]
@@ -9,6 +9,8 @@
[ext_resource type="Script" path="res://scripts/components/enemy_death.gd" id="6_6p3gr"]
[ext_resource type="Script" path="res://scripts/components/flashing_component.gd" id="7_xsaiy"]
[ext_resource type="Script" path="res://scripts/components/hit_component.gd" id="9_0qjr4"]
[ext_resource type="Script" path="res://scripts/components/fire_effect_component.gd" id="10_ej8vg"]
[ext_resource type="Script" path="res://scripts/components/ice_effect_component.gd" id="11_pq0k7"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_pwwji"]
size = Vector2(18, 27)
@@ -86,3 +88,16 @@ health_component = NodePath("../HealthComponent")
script = ExtResource("9_0qjr4")
sprite = NodePath("../Sprite2D")
health_component = NodePath("../HealthComponent")
[node name="FireEffectComponent" type="Node" parent="." node_paths=PackedStringArray("health_component", "root")]
script = ExtResource("10_ej8vg")
duration = 5.0
damage_per_second = 0.1
health_component = NodePath("../HealthComponent")
root = NodePath("..")
[node name="IceEffectComponent" type="Node" parent="." node_paths=PackedStringArray("side_to_side_movement", "periodic_shooting")]
script = ExtResource("11_pq0k7")
duration = 3.0
side_to_side_movement = NodePath("../SideToSideMovement")
periodic_shooting = NodePath("../PeriodicShootingComponent")

41
objects/fire_brick.tscn Normal file
View File

@@ -0,0 +1,41 @@
[gd_scene load_steps=5 format=3 uid="uid://daau4j5hbklk0"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_52l28"]
[ext_resource type="Script" path="res://scripts/components/bullet.gd" id="2_hjcob"]
[ext_resource type="Script" path="res://scripts/components/damage.gd" id="3_3ylb6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
size = Vector2(16, 10)
[node name="Brick" type="Area2D"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ar0xf")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_52l28")
hframes = 12
vframes = 12
frame = 80
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "visibility_notifier", "timer")]
script = ExtResource("2_hjcob")
root = NodePath("..")
speed = 120.0
area2d = NodePath("..")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
life_time = 2.0
timer = NodePath("../Timer")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(0, 2.38419e-07)
scale = Vector2(0.8, 0.5)
[node name="Timer" type="Timer" parent="."]
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d")]
script = ExtResource("3_3ylb6")
area2d = NodePath("..")
is_fire_brick = true

41
objects/ice_brick.tscn Normal file
View File

@@ -0,0 +1,41 @@
[gd_scene load_steps=5 format=3 uid="uid://bcmx07k12gcsc"]
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_xusxl"]
[ext_resource type="Script" path="res://scripts/components/bullet.gd" id="2_ilnf5"]
[ext_resource type="Script" path="res://scripts/components/damage.gd" id="3_htddx"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ar0xf"]
size = Vector2(16, 10)
[node name="Brick" type="Area2D"]
collision_layer = 16
collision_mask = 9
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ar0xf")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_xusxl")
hframes = 12
vframes = 12
frame = 80
[node name="BulletComponent" type="Node" parent="." node_paths=PackedStringArray("root", "area2d", "visibility_notifier", "timer")]
script = ExtResource("2_ilnf5")
root = NodePath("..")
speed = 120.0
area2d = NodePath("..")
visibility_notifier = NodePath("../VisibleOnScreenNotifier2D")
life_time = 2.0
timer = NodePath("../Timer")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(0, 2.38419e-07)
scale = Vector2(0.8, 0.5)
[node name="Timer" type="Timer" parent="."]
[node name="DamageComponent" type="Node" parent="." node_paths=PackedStringArray("area2d")]
script = ExtResource("3_htddx")
area2d = NodePath("..")
is_ice_brick = true