New sounds (and old sounds) for frog
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://5gjog7xbuemk"
|
||||
path="res://.godot/imported/frog_bubble.mp3-9d6e69a411a0b69784529b1b16cd03fb.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/minigames/frog/audio/frog_bubble.mp3"
|
||||
dest_files=["res://.godot/imported/frog_bubble.mp3-9d6e69a411a0b69784529b1b16cd03fb.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://bwgks2feyg6dr"
|
||||
path="res://.godot/imported/frog_splash.mp3-44440cc0290a4f37d73ef4251df61ae0.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/minigames/frog/audio/frog_splash.mp3"
|
||||
dest_files=["res://.godot/imported/frog_splash.mp3-44440cc0290a4f37d73ef4251df61ae0.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
+1
-1
@@ -30,10 +30,10 @@ buses/default_bus_layout="res://resources/audio_buses/main_audio_bus_layout.tres
|
||||
|
||||
[autoload]
|
||||
|
||||
Log="*res://sources/utils/autoloads/log.gd"
|
||||
Database="*res://sources/utils/autoloads/database.gd"
|
||||
Globals="*res://sources/language_tool/globals.gd"
|
||||
LessonLogger="*res://sources/utils/autoloads/lesson_logger.gd"
|
||||
Log="*res://sources/utils/autoloads/log.gd"
|
||||
MusicManager="*res://sources/utils/autoloads/music_manager.tscn"
|
||||
OpeningCurtain="*res://sources/utils/autoloads/opening_curtain.tscn"
|
||||
ServerManager="*res://sources/utils/autoloads/server_manager.tscn"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class_name Frog
|
||||
extends Control
|
||||
|
||||
signal defeated()
|
||||
signal jumped()
|
||||
|
||||
const JUMP_SOUNDS: Array[AudioStreamMP3] = [
|
||||
@@ -18,6 +17,8 @@ const FROG_SOUNDS: Array[AudioStreamMP3] = [
|
||||
preload("res://assets/minigames/frog/audio/frog_random_04.mp3"),
|
||||
preload("res://assets/minigames/frog/audio/frog_random_05.mp3"),
|
||||
]
|
||||
const FROG_SPLASH: AudioStreamMP3 = preload("res://assets/minigames/frog/audio/frog_splash.mp3")
|
||||
const FROG_BUBBLE: AudioStreamMP3 = preload("res://assets/minigames/frog/audio/frog_bubble.mp3")
|
||||
const JUMP_HEIGHT: float = 220.0
|
||||
|
||||
var blink_counter: int = 0
|
||||
@@ -57,12 +58,17 @@ func jump_to(destination: Vector2) -> void:
|
||||
1.0,
|
||||
duration
|
||||
).set_trans(Tween.TRANS_LINEAR)
|
||||
_play_jump_sound()
|
||||
|
||||
|
||||
func defeat() -> void:
|
||||
animated_sprite.play("flip_sad")
|
||||
await animated_sprite.animation_finished
|
||||
animated_sprite.play("defeat")
|
||||
audio_player.stream = FROG_SPLASH
|
||||
audio_player.play()
|
||||
await animated_sprite.animation_finished
|
||||
await audio_player.finished
|
||||
|
||||
|
||||
func success() -> void:
|
||||
@@ -85,7 +91,7 @@ func _play_jump_sound() -> void:
|
||||
audio_player.play()
|
||||
|
||||
|
||||
func _play_frog_sound() -> void:
|
||||
func play_frog_sound() -> void:
|
||||
var rand: float = randf()
|
||||
if rand <= 0.75:
|
||||
audio_player.stream = FROG_SOUNDS[randi() % FROG_SOUNDS.size()]
|
||||
@@ -95,6 +101,8 @@ func _play_frog_sound() -> void:
|
||||
func appear() -> void:
|
||||
global_position = last_valid_position
|
||||
animated_sprite.play("appear")
|
||||
audio_player.stream = FROG_BUBBLE
|
||||
audio_player.play()
|
||||
await animated_sprite.animation_finished
|
||||
await flip_happy()
|
||||
animated_sprite.play("idle_side")
|
||||
@@ -125,8 +133,6 @@ func _on_animated_sprite_2d_animation_finished() -> void:
|
||||
"jump":
|
||||
animated_sprite.play("idle_side")
|
||||
jumped.emit()
|
||||
"defeat":
|
||||
defeated.emit()
|
||||
|
||||
|
||||
func idle_boss() -> void:
|
||||
|
||||
@@ -48,8 +48,11 @@ func _reset_frog() -> void:
|
||||
#region Tracks management
|
||||
|
||||
func _free_tracks() -> void:
|
||||
var last_track: LilypadTrack
|
||||
for track: LilypadTrack in lilypad_tracks_container.get_children():
|
||||
await track.reset()
|
||||
last_track = track
|
||||
track.reset()
|
||||
await last_track.reset()
|
||||
|
||||
for track: LilypadTrack in lilypad_tracks_container.get_children():
|
||||
track.queue_free()
|
||||
@@ -78,7 +81,7 @@ func _start_tracks() -> void:
|
||||
var index: int = 0
|
||||
for track: LilypadTrack in lilypad_tracks_container.get_children():
|
||||
if index >= current_word_progression:
|
||||
await track.reset()
|
||||
track.reset()
|
||||
if not is_first_track_enabled:
|
||||
track.is_enabled = true
|
||||
is_first_track_enabled = true
|
||||
@@ -100,8 +103,7 @@ func _on_track_lilypad_in_center(lilypad: Lilypad, track: LilypadTrack) -> void:
|
||||
await lilypad.wrong()
|
||||
await audio_player.play_gp(lilypad.stimulus)
|
||||
lilypad.disappear()
|
||||
frog.defeat()
|
||||
await frog.defeated
|
||||
await frog.defeat()
|
||||
current_lives -= 1
|
||||
_start_tracks()
|
||||
await frog.appear()
|
||||
@@ -117,6 +119,7 @@ func _on_track_lilypad_in_center(lilypad: Lilypad, track: LilypadTrack) -> void:
|
||||
|
||||
func _on_current_word_progression_changed() -> void:
|
||||
# Enables the next track
|
||||
frog.play_frog_sound()
|
||||
for track: LilypadTrack in lilypad_tracks_container.get_children():
|
||||
if not track.is_cleared:
|
||||
track.is_enabled = true
|
||||
|
||||
Reference in New Issue
Block a user