Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/GTcreyon/SM63Redux
Browse files Browse the repository at this point in the history
  • Loading branch information
GTcreyon committed Apr 29, 2023
2 parents 2f15116 + c66a4c0 commit a8d19ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions classes/global/singleton/singleton.gd
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,10 @@ func save_input_map(input_json):
file.open("user://controls.json", File.WRITE)
file.store_string(input_json) # minimize the amount of time spent with the file open
file.close()


func reset_bus_effect(channel, effect_idx):
var bus_index = AudioServer.get_bus_index(channel)
var bus_effect = AudioServer.get_bus_effect(bus_index, effect_idx)
AudioServer.remove_bus_effect(bus_index, 0) # this just gets rid of any unwanted gunk stuck in the bus
AudioServer.add_bus_effect(bus_index, bus_effect, 0)
2 changes: 1 addition & 1 deletion classes/misc/twirl_heart/twirl_heart.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func _physics_process(_delta):
if crossed_item:
if mario.hp < 8:
if timer >= 30:
mario.recieve_health(1)
mario.receive_health(1)
timer = 0
else:
timer += 1
Expand Down
5 changes: 4 additions & 1 deletion classes/player/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ onready var feet_area: Area2D = $Feet


func _ready():

switch_state(S.NEUTRAL) # reset state to avoid short mario glitch

Singleton.reset_bus_effect("~Water Verb:", 0) # prevents garbage reverb

# If we came from another scene, load our data from that scene.
if Singleton.warp_location != null:
position = Singleton.warp_location
Expand Down Expand Up @@ -1387,7 +1390,7 @@ func off_ground():
cancel_ground = true


func recieve_health(amount):
func receive_health(amount):
hp = clamp(hp + amount, 0, 8) # TODO - multi HP


Expand Down

0 comments on commit a8d19ed

Please sign in to comment.