diff --git a/assets/SmokeEffect.png b/assets/SmokeEffect.png new file mode 100644 index 0000000..279cb24 Binary files /dev/null and b/assets/SmokeEffect.png differ diff --git a/assets/SmokeEffect.png.import b/assets/SmokeEffect.png.import new file mode 100644 index 0000000..d9c855e --- /dev/null +++ b/assets/SmokeEffect.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://i6ry58a42opo" +path="res://.godot/imported/SmokeEffect.png-d472aa3473f864c8007b26aa70d5c23a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/SmokeEffect.png" +dest_files=["res://.godot/imported/SmokeEffect.png-d472aa3473f864c8007b26aa70d5c23a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/enemies/lava_ant.gd b/scenes/enemies/lava_ant.gd index 7a9c355..6d9665b 100644 --- a/scenes/enemies/lava_ant.gd +++ b/scenes/enemies/lava_ant.gd @@ -19,6 +19,7 @@ func _on_attack_area_2d_body_entered(body): func explode(): animation_player.play("RESET") animated_sprite_2d.play("explode") + $ExplosionAudio.play() Globals.add_screenshake(0.3) for body in $AttackArea2D.get_overlapping_bodies(): if body is Enemy: diff --git a/scenes/enemies/lava_ant.tscn b/scenes/enemies/lava_ant.tscn index 5dbebcd..58a76cd 100644 --- a/scenes/enemies/lava_ant.tscn +++ b/scenes/enemies/lava_ant.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://d1mr1jwoop6vc"] +[gd_scene load_steps=18 format=3 uid="uid://d1mr1jwoop6vc"] [ext_resource type="Script" uid="uid://d13keqcgktvc4" path="res://scenes/enemies/lava_ant.gd" id="1_1ih35"] [ext_resource type="Material" uid="uid://cgls8su2rfgsh" path="res://shaders/flash_shader_material.tres" id="2_ey3sv"] @@ -9,6 +9,7 @@ [ext_resource type="Texture2D" uid="uid://d2qnxcrcwusfv" path="res://PlaceholderAssets/Explosion/explosion02.png" id="5_ba1pi"] [ext_resource type="Texture2D" uid="uid://c7v66xxgb11qx" path="res://PlaceholderAssets/Explosion/explosion03.png" id="6_ckxfm"] [ext_resource type="Texture2D" uid="uid://clmfdiep65s2d" path="res://assets/circle.png" id="9_ckxfm"] +[ext_resource type="AudioStream" uid="uid://p7cwke4uo0oc" path="res://assets/music/SoundFX/boom04.wav" id="10_bm7qs"] [sub_resource type="CircleShape2D" id="CircleShape2D_ey3sv"] radius = 50.0 @@ -184,6 +185,10 @@ texture = ExtResource("9_ckxfm") [node name="RayCast2D" type="RayCast2D" parent="."] rotation = 1.5708 +[node name="ExplosionAudio" type="AudioStreamPlayer" parent="."] +stream = ExtResource("10_bm7qs") +volume_db = -5.0 + [connection signal="body_entered" from="AttackArea2D" to="." method="_on_attack_area_2d_body_entered"] [connection signal="body_exited" from="AttackArea2D" to="." method="_on_attack_area_2d_body_exited"] [connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] diff --git a/scenes/globals.gd b/scenes/globals.gd index aa9e8a8..e793074 100644 --- a/scenes/globals.gd +++ b/scenes/globals.gd @@ -12,6 +12,9 @@ enum WeaponEnum { SHOTGUN, MACHINE_GUN } + +const PICKUP_AUDIO = preload("res://assets/music/SoundFX/pickup01.wav") + var inventory = [true,false,false] var damage_upgrades: int = 0 var firerate_upgrades: int = 0 diff --git a/scenes/hero.gd b/scenes/hero.gd index 8a4f7d6..7bac7e8 100644 --- a/scenes/hero.gd +++ b/scenes/hero.gd @@ -79,6 +79,7 @@ func _on_screenshake(amount: float) -> void: $Camera2D.add_shake(amount) func _on_collectable_collected(type: String): + $AudioStreamPlayer2D.play() if type == "crystal": #print("num collected: ", crystals_collected) $Hud/HBoxContainer/CrystalLabel.text = str(Globals.crystals_collected) @@ -158,6 +159,7 @@ func burn(input:call_state): call_state.Start: if not is_in_lava: $Label.text = "Burning" + $CPUParticles2DSmoke.emitting = true is_in_lava=true burn(call_state.Hold) call_state.Hold: @@ -176,12 +178,14 @@ func burn(input:call_state): is_burning_after = true await damage_over_time(2, 5, 2.0, 'Burning') $Label.text = "Player" + $CPUParticles2DSmoke.emitting = false func acidify(input: call_state): match input: call_state.Start: if not is_in_acid: $Label.text = "Acidic" + $CPUParticles2DSmoke.emitting = false is_in_acid=true acidify(call_state.Hold) call_state.Hold: @@ -197,6 +201,7 @@ func acidify(input: call_state): call_state.End: is_in_acid = false $Label.text = "Player" + $CPUParticles2DSmoke.emitting = false # func damage_over_time(damage: int, num_hits: int, wait_time: float, effect: String): $Label.text = effect @@ -213,3 +218,4 @@ func damage_over_time(damage: int, num_hits: int, wait_time: float, effect: Stri if effect == "Burning": is_burning_after = false $Label.text = "Player" + $CPUParticles2DSmoke.emitting = false diff --git a/scenes/hero.tscn b/scenes/hero.tscn index ee150f5..26bd22b 100644 --- a/scenes/hero.tscn +++ b/scenes/hero.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=20 format=3 uid="uid://qxbajo21gg4j"] +[gd_scene load_steps=23 format=3 uid="uid://qxbajo21gg4j"] [ext_resource type="Script" uid="uid://bplv08s5b0u13" path="res://scenes/hero.gd" id="1_w7pyx"] +[ext_resource type="Texture2D" uid="uid://i6ry58a42opo" path="res://assets/SmokeEffect.png" id="2_6mqrs"] [ext_resource type="Texture2D" uid="uid://hck1dqeicbyn" path="res://PlaceholderAssets/hero.png" id="2_mv13s"] [ext_resource type="Shader" uid="uid://b5amdpamwydut" path="res://shaders/teleport.gdshader" id="2_n40cg"] [ext_resource type="PackedScene" uid="uid://c4jn5ceehyndd" path="res://scenes/weapons/plasma_rifle.tscn" id="3_06baw"] @@ -11,6 +12,11 @@ [ext_resource type="PackedScene" uid="uid://dpav2ennn0x4p" path="res://scenes/weapons/shotgun.tscn" id="9_n5qna"] [ext_resource type="PackedScene" uid="uid://c3anhwxelnmxv" path="res://scenes/weapons/machine_gun.tscn" id="10_d6xj2"] [ext_resource type="AudioStream" uid="uid://d0dcuwp2v33lv" path="res://assets/music/SoundFX/teleport02.wav" id="11_d6xj2"] +[ext_resource type="AudioStream" uid="uid://d4a7c1qsd5knu" path="res://assets/music/SoundFX/pickup01.wav" id="12_sryfu"] + +[sub_resource type="Gradient" id="Gradient_k8rms"] +offsets = PackedFloat32Array(0, 0.627404, 0.995192, 1) +colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.113725, 1, 1, 1, 1) [sub_resource type="ShaderMaterial" id="ShaderMaterial_mo806"] shader = ExtResource("2_n40cg") @@ -157,6 +163,19 @@ script = ExtResource("1_w7pyx") [node name="MeleeAttackTimer" type="Timer" parent="."] +[node name="CPUParticles2DSmoke" type="CPUParticles2D" parent="."] +position = Vector2(-1, 37) +emitting = false +texture = ExtResource("2_6mqrs") +lifetime = 1.5 +gravity = Vector2(0, -200) +initial_velocity_max = 100.0 +scale_amount_max = 2.0 +color = Color(1, 1, 1, 0.890196) +color_ramp = SubResource("Gradient_k8rms") +hue_variation_min = -0.22 +hue_variation_max = 0.24 + [node name="Sprite2D" type="Sprite2D" parent="."] material = SubResource("ShaderMaterial_mo806") texture = ExtResource("2_mv13s") @@ -216,3 +235,6 @@ cooldown = 0.25 [node name="TeleportAudio" type="AudioStreamPlayer" parent="."] stream = ExtResource("11_d6xj2") volume_db = -5.0 + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("12_sryfu") diff --git a/shaders/flash_shader_material.tres b/shaders/flash_shader_material.tres index d304d08..be9c809 100644 --- a/shaders/flash_shader_material.tres +++ b/shaders/flash_shader_material.tres @@ -5,5 +5,5 @@ [resource] resource_local_to_scene = true shader = ExtResource("1_1quyw") -shader_parameter/active = true +shader_parameter/active = false shader_parameter/color = Color(1, 1, 1, 1)