minor tweaks and fixed barrel explosion
This commit is contained in:
Binary file not shown.
Binary file not shown.
202
assets/barrel_explosion.tscn
Normal file
202
assets/barrel_explosion.tscn
Normal file
File diff suppressed because one or more lines are too long
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ch7jxw5ghkgij" path="res://assets/Models/oildrum1.albedo.png" id="1_uppfj"]
|
[ext_resource type="Texture2D" uid="uid://ch7jxw5ghkgij" path="res://assets/Models/oildrum1.albedo.png" id="1_uppfj"]
|
||||||
[ext_resource type="Script" path="res://scripts/oildrum.gd" id="1_yvhou"]
|
[ext_resource type="Script" path="res://scripts/oildrum.gd" id="1_yvhou"]
|
||||||
[ext_resource type="PackedScene" uid="uid://6p7d7txcox7i" path="res://assets/rocket_explosion.tscn" id="2_507ct"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://coy85a3x5unp8" path="res://assets/Models/oildrum1.metallic.png" id="2_ip3os"]
|
[ext_resource type="Texture2D" uid="uid://coy85a3x5unp8" path="res://assets/Models/oildrum1.metallic.png" id="2_ip3os"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b2e6q2gs3alc3" path="res://assets/barrel_explosion.tscn" id="2_ww2l7"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ioiy6cm2ypl7" path="res://assets/Models/oildrum1.normal.png" id="3_ouyr7"]
|
[ext_resource type="Texture2D" uid="uid://ioiy6cm2ypl7" path="res://assets/Models/oildrum1.normal.png" id="3_ouyr7"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dhm0fgqc3nx2t" path="res://assets/Models/oildrum1.rough.png" id="4_t4407"]
|
[ext_resource type="Texture2D" uid="uid://dhm0fgqc3nx2t" path="res://assets/Models/oildrum1.rough.png" id="4_t4407"]
|
||||||
[ext_resource type="AudioStream" uid="uid://8w8imybwyxxa" path="res://assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3" id="6_iai82"]
|
[ext_resource type="AudioStream" uid="uid://8w8imybwyxxa" path="res://assets/Audio/Various SFX/gas-leak-SBA-300149983.mp3" id="6_iai82"]
|
||||||
@@ -73,14 +73,14 @@ height = 1.26931
|
|||||||
radius = 0.425725
|
radius = 0.425725
|
||||||
|
|
||||||
[node name="Oildrum1" type="RigidBody3D" groups=["leak"]]
|
[node name="Oildrum1" type="RigidBody3D" groups=["leak"]]
|
||||||
collision_layer = 160
|
collision_layer = 32
|
||||||
collision_mask = 253
|
collision_mask = 253
|
||||||
mass = 10.0
|
mass = 10.0
|
||||||
continuous_cd = true
|
continuous_cd = true
|
||||||
contact_monitor = true
|
contact_monitor = true
|
||||||
max_contacts_reported = 1
|
max_contacts_reported = 1
|
||||||
script = ExtResource("1_yvhou")
|
script = ExtResource("1_yvhou")
|
||||||
explosion = ExtResource("2_507ct")
|
explosion = ExtResource("2_ww2l7")
|
||||||
blast_power = 50.0
|
blast_power = 50.0
|
||||||
enemy_type = 1
|
enemy_type = 1
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,60 @@
|
|||||||
[gd_scene load_steps=10 format=3 uid="uid://6p7d7txcox7i"]
|
[gd_scene load_steps=14 format=3 uid="uid://6p7d7txcox7i"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/die_particles.gd" id="1_ssw3i"]
|
[ext_resource type="Script" path="res://scripts/die_particles.gd" id="1_ssw3i"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dn3b6uw8xr63m" path="res://assets/Textures/Smoke/smoketest_v1_0043.png" id="2_cag6r"]
|
||||||
[ext_resource type="AudioStream" uid="uid://6b5gg8b0p8k8" path="res://assets/Audio/Weapons/explosion-blast-SBA-300083684.wav" id="2_rbypu"]
|
[ext_resource type="AudioStream" uid="uid://6b5gg8b0p8k8" path="res://assets/Audio/Weapons/explosion-blast-SBA-300083684.wav" id="2_rbypu"]
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_e1gej"]
|
[sub_resource type="Curve" id="Curve_eqjwj"]
|
||||||
albedo_color = Color(0.586219, 0.0370184, 0.140967, 1)
|
_data = [Vector2(0, 0), 0.0, 1.4, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||||
emission_enabled = true
|
|
||||||
emission = Color(0.941176, 0, 0, 1)
|
|
||||||
emission_energy_multiplier = 8.0
|
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_741s1"]
|
|
||||||
min_value = -1.0
|
|
||||||
_data = [Vector2(0, -1), 0.0, 0.0, 0, 0, Vector2(1, 1), 2.8, 0.0, 0, 0]
|
|
||||||
point_count = 2
|
point_count = 2
|
||||||
|
|
||||||
[sub_resource type="CurveTexture" id="CurveTexture_7652j"]
|
[sub_resource type="CurveTexture" id="CurveTexture_ya0uq"]
|
||||||
curve = SubResource("Curve_741s1")
|
curve = SubResource("Curve_eqjwj")
|
||||||
|
|
||||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_evi0f"]
|
[sub_resource type="Gradient" id="Gradient_acjgf"]
|
||||||
direction = Vector3(0, 1, 0)
|
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
|
||||||
spread = 66.739
|
|
||||||
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_8kfxe"]
|
||||||
|
gradient = SubResource("Gradient_acjgf")
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_w037p"]
|
||||||
|
min_value = -1.0
|
||||||
|
_data = [Vector2(0, -1), 0.0, 2.8, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 2
|
||||||
|
|
||||||
|
[sub_resource type="CurveTexture" id="CurveTexture_aqpqn"]
|
||||||
|
curve = SubResource("Curve_w037p")
|
||||||
|
|
||||||
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_oxveh"]
|
||||||
|
particle_flag_rotate_y = true
|
||||||
|
emission_shape = 1
|
||||||
|
emission_sphere_radius = 0.1
|
||||||
|
velocity_pivot = Vector3(0, 1, 0)
|
||||||
|
direction = Vector3(1, 1, 1)
|
||||||
|
spread = 180.0
|
||||||
initial_velocity_min = 10.0
|
initial_velocity_min = 10.0
|
||||||
initial_velocity_max = 15.0
|
initial_velocity_max = 30.0
|
||||||
|
gravity = Vector3(0, 0.5, 0)
|
||||||
scale_min = 0.1
|
scale_min = 0.1
|
||||||
scale_max = 0.3
|
color_ramp = SubResource("GradientTexture1D_8kfxe")
|
||||||
hue_variation_min = 0.1
|
alpha_curve = SubResource("CurveTexture_ya0uq")
|
||||||
hue_variation_max = 0.2
|
hue_variation_curve = SubResource("CurveTexture_aqpqn")
|
||||||
hue_variation_curve = SubResource("CurveTexture_7652j")
|
turbulence_enabled = true
|
||||||
|
turbulence_noise_strength = 0.0
|
||||||
|
turbulence_noise_scale = 0.5
|
||||||
|
|
||||||
[sub_resource type="BoxMesh" id="BoxMesh_rsjsy"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pxrrg"]
|
||||||
|
transparency = 1
|
||||||
|
blend_mode = 1
|
||||||
|
shading_mode = 0
|
||||||
|
albedo_color = Color(1, 1, 1, 0.14902)
|
||||||
|
albedo_texture = ExtResource("2_cag6r")
|
||||||
|
billboard_mode = 1
|
||||||
|
|
||||||
[sub_resource type="Skin" id="Skin_v2ayh"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_pjpw2"]
|
||||||
|
material = SubResource("StandardMaterial3D_pxrrg")
|
||||||
|
size = Vector2(10, 10)
|
||||||
|
orientation = 2
|
||||||
|
|
||||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_e1p15"]
|
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_e1p15"]
|
||||||
random_pitch = 1.2
|
random_pitch = 1.2
|
||||||
@@ -42,19 +66,15 @@ script = ExtResource("1_ssw3i")
|
|||||||
audio_explode = NodePath("Audio/Explosion")
|
audio_explode = NodePath("Audio/Explosion")
|
||||||
|
|
||||||
[node name="dieParticles" type="GPUParticles3D" parent="."]
|
[node name="dieParticles" type="GPUParticles3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.17952, 0)
|
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 1.12633, 0, -0.00682099)
|
||||||
material_override = SubResource("StandardMaterial3D_e1gej")
|
|
||||||
cast_shadow = 0
|
|
||||||
emitting = false
|
emitting = false
|
||||||
amount = 250
|
amount = 500
|
||||||
lifetime = 5.0
|
lifetime = 4.0
|
||||||
one_shot = true
|
one_shot = true
|
||||||
explosiveness = 1.0
|
explosiveness = 1.0
|
||||||
trail_enabled = true
|
fixed_fps = 60
|
||||||
trail_lifetime = 3.2
|
process_material = SubResource("ParticleProcessMaterial_oxveh")
|
||||||
process_material = SubResource("ParticleProcessMaterial_evi0f")
|
draw_pass_1 = SubResource("PlaneMesh_pjpw2")
|
||||||
draw_pass_1 = SubResource("BoxMesh_rsjsy")
|
|
||||||
draw_skin = SubResource("Skin_v2ayh")
|
|
||||||
|
|
||||||
[node name="Audio" type="Node3D" parent="."]
|
[node name="Audio" type="Node3D" parent="."]
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,11 @@ collision_bounce = 0.0
|
|||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ntlp5"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ntlp5"]
|
||||||
transparency = 1
|
transparency = 1
|
||||||
blend_mode = 1
|
albedo_color = Color(0.278431, 0.647059, 0.85098, 1)
|
||||||
shading_mode = 0
|
|
||||||
albedo_color = Color(0.278431, 0.647059, 0.85098, 0.937255)
|
|
||||||
albedo_texture = ExtResource("1_x22sq")
|
albedo_texture = ExtResource("1_x22sq")
|
||||||
|
roughness = 0.0
|
||||||
|
backlight_enabled = true
|
||||||
|
backlight = Color(1, 1, 1, 1)
|
||||||
billboard_mode = 1
|
billboard_mode = 1
|
||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_ktpc0"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_ktpc0"]
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 19.6646, 0)
|
|||||||
mesh = SubResource("ArrayMesh_lh774")
|
mesh = SubResource("ArrayMesh_lh774")
|
||||||
skeleton = NodePath("")
|
skeleton = NodePath("")
|
||||||
|
|
||||||
[node name="StaticBody3D" type="StaticBody3D" parent="Water Tower"]
|
[node name="StaticBody3D" type="StaticBody3D" parent="Water Tower" groups=["leak"]]
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Water Tower/StaticBody3D"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Water Tower/StaticBody3D"]
|
||||||
shape = SubResource("ConcavePolygonShape3D_wo6r4")
|
shape = SubResource("ConcavePolygonShape3D_wo6r4")
|
||||||
|
|||||||
@@ -232,13 +232,13 @@ shadow_mesh = SubResource("ArrayMesh_3f3hx")
|
|||||||
_data = [Vector2(0, 0), 0.0, 1.4, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
_data = [Vector2(0, 0), 0.0, 1.4, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||||
point_count = 2
|
point_count = 2
|
||||||
|
|
||||||
[sub_resource type="CurveTexture" id="CurveTexture_csbqc"]
|
[sub_resource type="CurveTexture" id="CurveTexture_1r807"]
|
||||||
curve = SubResource("Curve_h8f1e")
|
curve = SubResource("Curve_h8f1e")
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_0viso"]
|
[sub_resource type="Gradient" id="Gradient_0viso"]
|
||||||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
|
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
|
||||||
|
|
||||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_rly2i"]
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_kenin"]
|
||||||
gradient = SubResource("Gradient_0viso")
|
gradient = SubResource("Gradient_0viso")
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_hewln"]
|
[sub_resource type="Curve" id="Curve_hewln"]
|
||||||
@@ -246,7 +246,7 @@ min_value = -1.0
|
|||||||
_data = [Vector2(0, -1), 0.0, 2.8, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
_data = [Vector2(0, -1), 0.0, 2.8, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||||
point_count = 2
|
point_count = 2
|
||||||
|
|
||||||
[sub_resource type="CurveTexture" id="CurveTexture_6yvtl"]
|
[sub_resource type="CurveTexture" id="CurveTexture_wyie8"]
|
||||||
curve = SubResource("Curve_hewln")
|
curve = SubResource("Curve_hewln")
|
||||||
|
|
||||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_xmjr3"]
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_xmjr3"]
|
||||||
@@ -259,14 +259,14 @@ spread = 9.706
|
|||||||
initial_velocity_max = 1.0
|
initial_velocity_max = 1.0
|
||||||
gravity = Vector3(0, 0.5, 0)
|
gravity = Vector3(0, 0.5, 0)
|
||||||
scale_min = 0.1
|
scale_min = 0.1
|
||||||
color_ramp = SubResource("GradientTexture1D_rly2i")
|
color_ramp = SubResource("GradientTexture1D_kenin")
|
||||||
alpha_curve = SubResource("CurveTexture_csbqc")
|
alpha_curve = SubResource("CurveTexture_1r807")
|
||||||
hue_variation_curve = SubResource("CurveTexture_6yvtl")
|
hue_variation_curve = SubResource("CurveTexture_wyie8")
|
||||||
turbulence_enabled = true
|
turbulence_enabled = true
|
||||||
turbulence_noise_strength = 0.0
|
turbulence_noise_strength = 0.0
|
||||||
turbulence_noise_scale = 0.5
|
turbulence_noise_scale = 0.5
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dgj1t"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5d452"]
|
||||||
transparency = 1
|
transparency = 1
|
||||||
blend_mode = 1
|
blend_mode = 1
|
||||||
shading_mode = 0
|
shading_mode = 0
|
||||||
@@ -275,7 +275,7 @@ albedo_texture = ExtResource("9_fldbw")
|
|||||||
billboard_mode = 1
|
billboard_mode = 1
|
||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_756l0"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_756l0"]
|
||||||
material = SubResource("StandardMaterial3D_dgj1t")
|
material = SubResource("StandardMaterial3D_5d452")
|
||||||
size = Vector2(1, 1)
|
size = Vector2(1, 1)
|
||||||
orientation = 2
|
orientation = 2
|
||||||
|
|
||||||
|
|||||||
35
scripts/barrel_explosion.gd
Normal file
35
scripts/barrel_explosion.gd
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
@onready var top_part: RigidBody3D = $TopPart
|
||||||
|
@onready var explosion_audio: AudioStreamPlayer3D = $Explosion
|
||||||
|
@onready var die_particles: GPUParticles3D = $dieParticles
|
||||||
|
|
||||||
|
@onready var collision_shapes = [$TopPart/CollisionShape3D, $BottomPart/CollisionShape3D]
|
||||||
|
|
||||||
|
const MAX_LV = 20
|
||||||
|
const MAX_AV = 20
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
var lv_x = randf_range(-MAX_LV,MAX_LV)
|
||||||
|
var lv_y = randf_range(0,MAX_LV)
|
||||||
|
var lv_z = randf_range(-MAX_LV,MAX_LV)
|
||||||
|
var av_x = randf_range(-MAX_AV,MAX_AV)
|
||||||
|
var av_y = randf_range(-MAX_AV,MAX_AV)
|
||||||
|
var av_z = randf_range(-MAX_AV,MAX_AV)
|
||||||
|
|
||||||
|
top_part.linear_velocity += Vector3(lv_x,lv_y,lv_z)
|
||||||
|
top_part.angular_velocity += Vector3(av_x,av_y,av_z)
|
||||||
|
explosion_audio.play()
|
||||||
|
die_particles.emitting = true
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _on_timer_timeout() -> void:
|
||||||
|
for i in collision_shapes:
|
||||||
|
i.disabled = true
|
||||||
|
await get_tree().create_timer(1).timeout
|
||||||
|
queue_free()
|
||||||
@@ -67,7 +67,7 @@ func _physics_process(delta):
|
|||||||
leakspawn.rotation.z = deg_to_rad(randf_range(0,360))
|
leakspawn.rotation.z = deg_to_rad(randf_range(0,360))
|
||||||
|
|
||||||
if body.is_in_group("switch"):
|
if body.is_in_group("switch"):
|
||||||
body.hit()
|
body.hit(bullet_damage)
|
||||||
|
|
||||||
if body.is_in_group("breakable"):
|
if body.is_in_group("breakable"):
|
||||||
var current_velocity = transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
var current_velocity = transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ func _on_body_entered(body: Node) -> void:
|
|||||||
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal())
|
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal())
|
||||||
|
|
||||||
if body.is_in_group("switch"):
|
if body.is_in_group("switch"):
|
||||||
body.hit()
|
body.hit(bullet_damage)
|
||||||
|
|
||||||
|
|
||||||
if body.is_in_group("breakable"):
|
if body.is_in_group("breakable"):
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ func _on_body_entered(body: Node) -> void:
|
|||||||
if body != null and !body.is_in_group("player") and linear_velocity.length() >= VELOCITY_REQUIRED_TO_HIT:
|
if body != null and !body.is_in_group("player") and linear_velocity.length() >= VELOCITY_REQUIRED_TO_HIT:
|
||||||
|
|
||||||
if body.is_in_group("switch"):
|
if body.is_in_group("switch"):
|
||||||
body.hit()
|
body.hit(bullet_damage)
|
||||||
|
|
||||||
if body.is_in_group("breakable"):
|
if body.is_in_group("breakable"):
|
||||||
var current_velocity = transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
var current_velocity = transform.basis * Vector3(0,0,-1 * bullet_force_mod)
|
||||||
|
|||||||
Reference in New Issue
Block a user