Skip to content

Commit

Permalink
[sound] wizard + grabitem impl
Browse files Browse the repository at this point in the history
  • Loading branch information
ThronoCrigger committed Mar 8, 2024
1 parent 80758ab commit d17208f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions attacks/wiz_zone.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ class_name WizZone extends RigidBody2D

@onready var zone: Area2D = $Area2D
var stats: Stats
@export var cast_event: EventAsset
var cast_sfx: EventInstance

func _ready():
cast_sfx = FMODRuntime.create_instance(cast_event)
cast_sfx.start()

func collide():
for body in zone.get_overlapping_bodies():
Expand Down
11 changes: 10 additions & 1 deletion attacks/wiz_zone.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
[gd_scene load_steps=7 format=3 uid="uid://x1tw8sl2is6b"]
[gd_scene load_steps=8 format=3 uid="uid://x1tw8sl2is6b"]

[ext_resource type="Shader" path="res://items/wave.gdshader" id="1_71a14"]
[ext_resource type="Script" path="res://attacks/wiz_zone.gd" id="1_bnnnb"]

[sub_resource type="EventAsset" id="EventAsset_kf377"]
is_oneshot = true
min_distance = 1.0
max_distance = 20.0
path = "event:/Wizard Cast"
guid = "{9763df43-0a81-49ef-9c77-534d79280aa0}"
name = "Wizard Cast"

[sub_resource type="ShaderMaterial" id="ShaderMaterial_8ygun"]
shader = ExtResource("1_71a14")
shader_parameter/width = 24.0
Expand Down Expand Up @@ -71,6 +79,7 @@ radius = 24.0
mass = 0.02
lock_rotation = true
script = ExtResource("1_bnnnb")
cast_event = SubResource("EventAsset_kf377")

[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource("ShaderMaterial_8ygun")
Expand Down
4 changes: 3 additions & 1 deletion autoload/audio.gd
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
extends Node

enum SFX { Select, Back }
enum SFX { Select, Back, GrabItem }

func play_sfx(sfx: SFX):
match sfx:
SFX.Select:
FMODRuntime.play_one_shot_path("event:/UI_Select")
SFX.Back:
FMODRuntime.play_one_shot_path("event:/UI_Back")
SFX.GrabItem:
FMODRuntime.play_one_shot_path("event:/Grab Item")


3 changes: 2 additions & 1 deletion entities/hero/hero.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[ext_resource type="PackedScene" uid="uid://dgul0eolhcq2n" path="res://entities/stats.tscn" id="2_25foy"]
[ext_resource type="Texture2D" uid="uid://d4ibrl4nmd57w" path="res://assets/MRMOTEXT_EX.png" id="2_g2vsp"]
[ext_resource type="Script" path="res://entities/hero/FightZone.gd" id="5_xmbvs"]
[ext_resource type="EventAsset" uid="uid://cmdbapmvmglmv" path="res://addons/FMOD/editor/resources/events/{11055db4-7ce9-49b0-8c44-c8c5a71c834a}.tres" id="6_5ol6p"]
[ext_resource type="EventAsset" uid="uid://ctu8kway4nlaa" path="res://addons/FMOD/editor/resources/events/{11055db4-7ce9-49b0-8c44-c8c5a71c834a}.tres" id="6_5ol6p"]
[ext_resource type="PackedScene" uid="uid://2upqhrf5ek4c" path="res://attacks/dash_manager.tscn" id="7_iljwf"]
[ext_resource type="Script" path="res://entities/hero/ActiveZone.gd" id="8_3bxfe"]

Expand Down Expand Up @@ -94,6 +94,7 @@ texture = SubResource("AtlasTexture_78j2y")

[node name="FightZone" type="Area2D" parent="."]
visible = false
show_behind_parent = true
collision_layer = 0
collision_mask = 4
monitorable = false
Expand Down
1 change: 1 addition & 0 deletions scenes/inventory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func is_full() -> bool:

func add_item(item: Item):
items.append(item)
Audio.play_sfx(Audio.SFX.GrabItem)
update()


Expand Down
Binary file modified sounds/Desktop/Master.bank
Binary file not shown.
Binary file modified sounds/Desktop/Master.strings.bank
Binary file not shown.

0 comments on commit d17208f

Please sign in to comment.