Mask sound + orb scene

This commit is contained in:
Sagi Dayan 2020-11-25 18:35:48 -05:00
parent 40e752c86e
commit c500d12973
16 changed files with 280 additions and 28 deletions

Binary file not shown.

View file

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/mask_fire.wav-58287c49aa70a9ad1c6b6fde9e25da71.sample"
[deps]
source_file="res://assets/Audio/SFX/mask_fire.wav"
dest_files=[ "res://.import/mask_fire.wav-58287c49aa70a9ad1c6b6fde9e25da71.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0

BIN
assets/Items/orb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/orb.png-7d062b1b1b0d571163241b14b5867c2b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Items/orb.png"
dest_files=[ "res://.import/orb.png-7d062b1b1b0d571163241b14b5867c2b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View file

@ -344,4 +344,7 @@ func set_position(pos:Vector2):
_falling_start_position = pos.y
func boost(velocity:Vector2):
if _state == States.DASHING:
_on_DashTimeout_timeout(false)
# _velocity = Vector2.ZERO
_boost_velocity = velocity

View file

@ -20,9 +20,7 @@ var _level_resources := {
}
var _levels = [
[_level_resources.pre_game, _level_resources.hub],
[_level_resources.zones[1][0]],
[load("res://src/GameWorld/Levels/FirstLevels/TMP2.tscn")]
[_level_resources.pre_game, _level_resources.zones[1][0]],
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -23,7 +23,7 @@ func _physics_process(delta: float) -> void:
$UI/CoinLabel.text = str(fresh_data.coins)
_play_update_label_animation($UI/CoinLabel/AnimationPlayer)
"orbs":
$UI/OrbsLable.text = str(fresh_data.coins)
$UI/OrbsLable.text = str(fresh_data.orbs)
_play_update_label_animation($UI/OrbsLable/AnimationPlayer)
"deaths":
$UI/DeathsLabel.text = str(fresh_data.deaths)

View file

@ -53,9 +53,11 @@ func _on_fire_animation_ended():
_activated = false
$TimeoutTimer.start(timeout)
else:
$AnimationPlayer.play("fire")
$AnimationPlayer.play("fire")
pass
func play_sfx():
AudioManager.play_sfx(AudioManager.Sfx.MASK_FIRE)
func _on_TimeoutTimer_timeout()->void:
_can_activate = true;

View file

@ -41,10 +41,13 @@ tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0.3 ),
"transitions": PoolRealArray( 1 ),
"times": PoolRealArray( 0.1, 0.3 ),
"transitions": PoolRealArray( 1, 1 ),
"values": [ {
"args": [ ],
"method": "play_sfx"
}, {
"args": [ ],
"method": "_on_fire_animation_ended"
} ]
}
@ -72,7 +75,7 @@ script = ExtResource( 2 )
position = Vector2( 7, -8 )
texture = ExtResource( 1 )
hframes = 6
frame = 1
frame = 3
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "armed"

View file

@ -215,11 +215,12 @@ collision_layer = 16
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -4 )
self_modulate = Color( 1, 1, 1, 0 )
position = Vector2( 0, -8 )
texture = ExtResource( 1 )
vframes = 2
hframes = 6
frame = 2
frame = 11
[node name="Light2D" type="Light2D" parent="Sprite"]
texture = ExtResource( 4 )
@ -231,6 +232,7 @@ range_item_cull_mask = 1025
visible = false
position = Vector2( 0, -4 )
shape = SubResource( 1 )
disabled = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "idle"
@ -238,12 +240,11 @@ anims/collected = SubResource( 2 )
anims/idle = SubResource( 3 )
[node name="Label" type="Label" parent="."]
visible = false
margin_left = -4.0
margin_top = -10.0
margin_right = 13.0
margin_bottom = -1.0
rect_scale = Vector2( 0.5, 0.5 )
self_modulate = Color( 1, 1, 1, 0 )
margin_left = -8.0
margin_top = -16.0
margin_right = 9.0
margin_bottom = -7.0
size_flags_horizontal = 15
size_flags_vertical = 15
theme = ExtResource( 3 )

7
src/Items/Orb.gd Normal file
View file

@ -0,0 +1,7 @@
extends Area2D
func _on_body_entered(body:Node)->void:
if body.name == "Player":
AudioManager.play_sfx(AudioManager.Sfx.COIN_COLLECTION)
GameState.orb_collected()
$AnimationPlayer.play("collected")

155
src/Items/Orb.tscn Normal file
View file

@ -0,0 +1,155 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://assets/Items/orb.png" type="Texture" id=1]
[ext_resource path="res://src/Items/Orb.gd" type="Script" id=2]
[ext_resource path="res://assets/Items/torch_ligt_texture.png" type="Texture" id=3]
[sub_resource type="Animation" id=1]
resource_name = "collected"
length = 0.6
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.5, 0.6 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 6, 7, 8, 9, 10, 11 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/2/type = "method"
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0.6 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "queue_free"
} ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Light2D:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -4 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Light2D:energy")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0, 0.6 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 1.0, 0.0 ]
}
[sub_resource type="Animation" id=2]
resource_name = "idle"
length = 0.5
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 2, 3, 4, 5 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Light2D:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 0, -4 ), Vector2( 0, -5 ), Vector2( 0, -5 ), Vector2( 0, -4 ), Vector2( 0, -3 ), Vector2( 0, -3 ) ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Light2D:energy")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 1.0 ]
}
[sub_resource type="CircleShape2D" id=3]
radius = 4.0
[node name="Orb" type="Area2D"]
collision_layer = 16
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -4 )
scale = Vector2( 1.5, 1.5 )
texture = ExtResource( 1 )
vframes = 2
hframes = 6
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "idle"
anims/collected = SubResource( 1 )
anims/idle = SubResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -4 )
shape = SubResource( 3 )
[node name="Light2D" type="Light2D" parent="."]
position = Vector2( 0, -4 )
texture = ExtResource( 3 )
texture_scale = 2.32
color = Color( 0.745098, 0.901961, 0.901961, 1 )
range_item_cull_mask = 1025
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View file

@ -32,7 +32,8 @@ enum Sfx{
UI_SELECT,
SPRING,
SPIKE_TRAP,
VASE_BREAK
VASE_BREAK,
MASK_FIRE
}
var _sfx_files := {
@ -44,6 +45,7 @@ var _sfx_files := {
Sfx.PLAYER_DIE : load("res://assets/Audio/SFX/player_die.wav"),
Sfx.SPRING : load("res://assets/Audio/SFX/spring.wav"),
Sfx.SPIKE_TRAP : load("res://assets/Audio/SFX/spike_trap.wav"),
Sfx.MASK_FIRE : load("res://assets/Audio/SFX/mask_fire.wav"),
Sfx.VASE_BREAK : load("res://assets/Audio/SFX/vase_break.wav"),
Sfx.UI_MOVE : load("res://assets/Audio/UI_Sounds/menu_move_sound.wav"),
Sfx.UI_SELECT : '',

View file

@ -146,3 +146,8 @@ func player_died():
func coin_collected():
_run_data.coins += 10
_data.statistics.coins += 10
func orb_collected():
print("orb collected")
_run_data.orbs += 1
_data.statistics.orbs += 1