Added visual effects for jetpack in (particles and light - doens't work!)
parent
78c2429f9e
commit
6ca7e4873d
|
@ -127,10 +127,15 @@ func jetpack_empty(delta):
|
|||
if jetpack_active and not jetpack_used and jetpack_fuel > 0:
|
||||
velocity.y += JETPACK_THRUST * delta
|
||||
jetpack_fuel -= delta
|
||||
|
||||
$Sounds/Jetpack.stream_paused = false
|
||||
else:
|
||||
$Sounds/Jetpack.stream_paused = true
|
||||
|
||||
# activate visual jetpack effects when sound is playing:
|
||||
$Effects/JetpackParticles.emitting = not $Sounds/Jetpack.stream_paused
|
||||
$Effects/JetpackLight.visible = not $Sounds/Jetpack.stream_paused
|
||||
|
||||
# Only charge when fully empty.
|
||||
if jetpack_used:
|
||||
jetpack_fuel = clamp(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=30 format=2]
|
||||
[gd_scene load_steps=39 format=2]
|
||||
|
||||
[ext_resource path="res://Classes/UI/Health.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Classes/UI/Billboard.gd" type="Script" id=2]
|
||||
|
@ -10,6 +10,8 @@
|
|||
[ext_resource path="res://Classes/Player/Player.gd" type="Script" id=8]
|
||||
[ext_resource path="res://Classes/Player/WeaponsManager.gd" type="Script" id=9]
|
||||
[ext_resource path="res://Assets/Weapons/Handgun/OtherHandgun.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://Assets/Effects/CircleSoft.svg" type="Texture" id=11]
|
||||
[ext_resource path="res://Assets/Maps/DM1/OmniFlicker.gd" type="Script" id=12]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id=1]
|
||||
animation = "Idle"
|
||||
|
@ -131,6 +133,48 @@ size = Vector2( 2, 0.6 )
|
|||
radius = 0.33
|
||||
height = 1.1
|
||||
|
||||
[sub_resource type="Gradient" id=20]
|
||||
offsets = PoolRealArray( 0, 0.10596, 0.492274, 1 )
|
||||
colors = PoolColorArray( 0.384073, 0.892747, 0.95459, 1, 1, 0.917511, 0.378906, 1, 0.868652, 0.31811, 0, 1, 1, 0, 0, 0 )
|
||||
|
||||
[sub_resource type="GradientTexture" id=27]
|
||||
gradient = SubResource( 20 )
|
||||
|
||||
[sub_resource type="Curve" id=28]
|
||||
_data = [ Vector2( 0, 0.206818 ), 0.0, 11.151, 0, 0, Vector2( 0.0987395, 0.825 ), 1.4875, 1.4875, 0, 0, Vector2( 1, 0.515909 ), -1.23636, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=23]
|
||||
curve = SubResource( 28 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=24]
|
||||
lifetime_randomness = 0.25
|
||||
direction = Vector3( 0, -15, 0 )
|
||||
spread = 0.01
|
||||
gravity = Vector3( 0, 0, 0 )
|
||||
initial_velocity = 7.0
|
||||
initial_velocity_random = 0.1
|
||||
damping = 10.0
|
||||
damping_random = 0.2
|
||||
scale = 2.0
|
||||
scale_random = 0.2
|
||||
scale_curve = SubResource( 23 )
|
||||
color_ramp = SubResource( 27 )
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=25]
|
||||
flags_transparent = true
|
||||
flags_unshaded = true
|
||||
vertex_color_use_as_albedo = true
|
||||
params_blend_mode = 1
|
||||
params_billboard_mode = 3
|
||||
particles_anim_h_frames = 1
|
||||
particles_anim_v_frames = 1
|
||||
particles_anim_loop = false
|
||||
albedo_texture = ExtResource( 11 )
|
||||
|
||||
[sub_resource type="QuadMesh" id=26]
|
||||
material = SubResource( 25 )
|
||||
size = Vector2( 0.3, 0.3 )
|
||||
|
||||
[node name="Player" type="KinematicBody"]
|
||||
script = ExtResource( 8 )
|
||||
|
||||
|
@ -138,7 +182,7 @@ script = ExtResource( 8 )
|
|||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.53592, -0.0651628 )
|
||||
|
||||
[node name="Hand" type="Spatial" parent="Camera"]
|
||||
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.390279, -0.559 )
|
||||
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.399882, -0.559 )
|
||||
|
||||
[node name="WeaponBobAnimationTree" type="AnimationTree" parent="Camera/Hand"]
|
||||
tree_root = SubResource( 12 )
|
||||
|
@ -214,6 +258,29 @@ __meta__ = {
|
|||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Effects" type="Spatial" parent="."]
|
||||
|
||||
[node name="JetpackParticles" type="Particles" parent="Effects"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.317267, 0 )
|
||||
emitting = false
|
||||
amount = 32
|
||||
lifetime = 0.3
|
||||
visibility_aabb = AABB( -0.88845, -4.39128, -1.0129, 1.77577, 4.6895, 2.02716 )
|
||||
local_coords = false
|
||||
process_material = SubResource( 24 )
|
||||
draw_pass_1 = SubResource( 26 )
|
||||
|
||||
[node name="JetpackLight" type="OmniLight" parent="Effects"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.317267, 0 )
|
||||
visible = false
|
||||
light_color = Color( 0.956863, 0.839216, 0.478431, 1 )
|
||||
light_energy = 2.0
|
||||
shadow_enabled = true
|
||||
omni_range = 12.0
|
||||
omni_attenuation = 2.54912
|
||||
script = ExtResource( 12 )
|
||||
noise_amount = 0.1
|
||||
|
||||
[node name="Sounds" type="Spatial" parent="."]
|
||||
|
||||
[node name="Jump" parent="Sounds" instance=ExtResource( 5 )]
|
||||
|
@ -239,12 +306,5 @@ unit_db = -12.0
|
|||
autoplay = true
|
||||
stream_paused = true
|
||||
|
||||
[node name="Ambient" type="AudioStreamPlayer3D" parent="Sounds"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00283742, 0.541029, -0.000331998 )
|
||||
unit_db = -24.0
|
||||
unit_size = 15.0
|
||||
autoplay = true
|
||||
attenuation_filter_cutoff_hz = 15000.0
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource( 7 )]
|
||||
visible = false
|
||||
|
|
Reference in New Issue