mirror of
https://github.com/Steffo99/pineapple-surf.git
synced 2024-11-25 01:04:18 +00:00
Add splash sound and respawn
This commit is contained in:
parent
ef3b031c16
commit
08349d4f43
5 changed files with 44 additions and 2 deletions
BIN
assets/splash.ogg
(Stored with Git LFS)
Normal file
BIN
assets/splash.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
19
assets/splash.ogg.import
Normal file
19
assets/splash.ogg.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://xretxahxbqdr"
|
||||
path="res://.godot/imported/splash.ogg-531703e6bdcbdfaa68fabbaa897f2b6c.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/splash.ogg"
|
||||
dest_files=["res://.godot/imported/splash.ogg-531703e6bdcbdfaa68fabbaa897f2b6c.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0.0
|
||||
bpm=0.0
|
||||
beat_count=0
|
||||
bar_beats=4
|
|
@ -3,7 +3,7 @@
|
|||
[ext_resource type="Shader" path="res://island/Sea.gdshader" id="1_agjfy"]
|
||||
[ext_resource type="Texture2D" uid="uid://bdoifsf6k0qb8" path="res://assets/water_tile.png" id="1_w6ara"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://c8knvy5ras8jo" path="res://assets/island_model/island.obj" id="2_r00hx"]
|
||||
[ext_resource type="PackedScene" path="res://player/Player.tscn" id="3_5378m"]
|
||||
[ext_resource type="PackedScene" uid="uid://b5i1sqd88wlle" path="res://player/Player.tscn" id="3_5378m"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://b7jov7hxhbq6j" path="res://assets/island_model/hill.obj" id="5_wot4t"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_78lo3"]
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
[gd_scene load_steps=16 format=3]
|
||||
[gd_scene load_steps=18 format=3 uid="uid://b5i1sqd88wlle"]
|
||||
|
||||
[ext_resource type="Script" path="res://player/Player.gd" id="1_rujcr"]
|
||||
[ext_resource type="Script" path="res://player/Head.gd" id="2_ohlgu"]
|
||||
[ext_resource type="Script" path="res://player/OnHand.gd" id="3_3rcjl"]
|
||||
[ext_resource type="Shader" path="res://player/crosshair.gdshader" id="4_dut1p"]
|
||||
[ext_resource type="Script" path="res://player/SplashController.gd" id="5_wnbq8"]
|
||||
[ext_resource type="AudioStream" uid="uid://xretxahxbqdr" path="res://assets/splash.ogg" id="6_xi537"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_berhm"]
|
||||
|
||||
|
@ -270,3 +272,9 @@ position = Vector2(140, 79)
|
|||
scale = Vector2(1.65, 1)
|
||||
|
||||
[node name="RigidDynamicBody3D" type="RigidBody3D" parent="."]
|
||||
|
||||
[node name="SplashController" type="Node" parent="."]
|
||||
script = ExtResource("5_wnbq8")
|
||||
|
||||
[node name="SplashSound" type="AudioStreamPlayer" parent="SplashController"]
|
||||
stream = ExtResource("6_xi537")
|
||||
|
|
12
player/SplashController.gd
Normal file
12
player/SplashController.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends Node
|
||||
|
||||
|
||||
@onready var player: Node3D = $".."
|
||||
@onready var spawn_point: Vector3 = player.position
|
||||
@onready var splash_sound: AudioStreamPlayer = $SplashSound
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
if player.position.y < 0:
|
||||
splash_sound.play()
|
||||
player.position = spawn_point
|
Loading…
Reference in a new issue