Merge branch 'main' of community.rokojori.com:eggnot/first_anniversary_godot_jam
This commit is contained in:
commit
825bf5ba3f
|
@ -2,8 +2,12 @@
|
|||
|
||||
[ext_resource path="res://3d_platforma/Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://3d_platforma/golden_bay_512.hdr" type="Texture" id=2]
|
||||
[ext_resource path="res://Scripts/Library/Actions/Snare Admiral 2.wav" type="AudioStream" id=3]
|
||||
[ext_resource path="res://3d_platforma/sqare_norm.png" type="Texture" id=4]
|
||||
[ext_resource path="res://3d_platforma/texture_08.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Scripts/Library/Actions/TriggerOnReady.gd" type="Script" id=6]
|
||||
[ext_resource path="res://Scripts/Library/Actions/ActionList.gd" type="Script" id=7]
|
||||
[ext_resource path="res://Scripts/Library/Actions/SFX BlackTiger.wav" type="AudioStream" id=8]
|
||||
|
||||
[sub_resource type="CubeMesh" id=1]
|
||||
|
||||
|
@ -160,3 +164,24 @@ light_energy = 0.65
|
|||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource( 24 )
|
||||
|
||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource( 3 )
|
||||
|
||||
[node name="AudioStreamPlayer3D2" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource( 8 )
|
||||
|
||||
[node name="TriggerOnReady" type="Node" parent="."]
|
||||
script = ExtResource( 6 )
|
||||
action = NodePath("../ActionList")
|
||||
|
||||
[node name="ActionList" type="Node" parent="."]
|
||||
script = ExtResource( 7 )
|
||||
|
||||
[node name="PlaySound" type="Node" parent="ActionList"]
|
||||
script = ExtResource( 1 )
|
||||
audioStreamPlayer = NodePath("../../AudioStreamPlayer3D")
|
||||
|
||||
[node name="PlaySound2" type="Node" parent="ActionList"]
|
||||
script = ExtResource( 1 )
|
||||
audioStreamPlayer = NodePath("../../AudioStreamPlayer3D2")
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
[gd_scene format=2]
|
||||
|
||||
[node name="Spatial" type="Spatial"]
|
|
@ -0,0 +1,12 @@
|
|||
# Blender MTL File: 'tape.blend'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material
|
||||
Ns 96.078431
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
File diff suppressed because it is too large
Load Diff
|
@ -8,6 +8,46 @@
|
|||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ {
|
||||
"base": "Node",
|
||||
"class": "Action",
|
||||
"language": "GDScript",
|
||||
"path": "res://Scripts/Library/Actions/Action.gd"
|
||||
}, {
|
||||
"base": "Action",
|
||||
"class": "ActionList",
|
||||
"language": "GDScript",
|
||||
"path": "res://Scripts/Library/Actions/ActionList.gd"
|
||||
}, {
|
||||
"base": "Node",
|
||||
"class": "MusicChangedSlowAction",
|
||||
"language": "GDScript",
|
||||
"path": "res://Scripts/OnMusicChangedSlowTrigger.gd"
|
||||
}, {
|
||||
"base": "Action",
|
||||
"class": "PlaySound",
|
||||
"language": "GDScript",
|
||||
"path": "res://Scripts/Library/Actions/PlaySound.gd"
|
||||
}, {
|
||||
"base": "Node",
|
||||
"class": "TriggerBase",
|
||||
"language": "GDScript",
|
||||
"path": "res://Scripts/Library/Actions/TriggerBase.gd"
|
||||
}, {
|
||||
"base": "TriggerBase",
|
||||
"class": "TriggerOnReady",
|
||||
"language": "GDScript",
|
||||
"path": "res://Scripts/Library/Actions/TriggerOnReady.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"Action": "",
|
||||
"ActionList": "",
|
||||
"MusicChangedSlowAction": "",
|
||||
"PlaySound": "",
|
||||
"TriggerBase": "",
|
||||
"TriggerOnReady": ""
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="first_anniversary_godot_jam"
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
class_name Action
|
||||
extends Node
|
||||
|
||||
func triggerNodePath( nodePath:NodePath ):
|
||||
|
||||
var a:Action = get_node( nodePath );
|
||||
triggerAction( a )
|
||||
|
||||
|
||||
func triggerAction( a:Action ):
|
||||
|
||||
if a == null:
|
||||
return
|
||||
|
||||
a.onTrigger()
|
||||
|
||||
func onTrigger():
|
||||
pass
|
|
@ -0,0 +1,12 @@
|
|||
class_name ActionList
|
||||
extends Action
|
||||
|
||||
|
||||
func onTrigger():
|
||||
var children = get_children()
|
||||
|
||||
for c in children:
|
||||
triggerAction( c )
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
class_name PlaySound
|
||||
extends Action
|
||||
|
||||
export(NodePath) var audioStreamPlayer
|
||||
|
||||
func _ready():
|
||||
onTrigger()
|
||||
|
||||
|
||||
func onTrigger():
|
||||
get_node( audioStreamPlayer ).play()
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,18 @@
|
|||
class_name TriggerBase
|
||||
extends Node
|
||||
|
||||
|
||||
func triggerNodePath( nodePath:NodePath ):
|
||||
|
||||
var a:Action = get_node( nodePath );
|
||||
|
||||
triggerAction( a )
|
||||
|
||||
|
||||
|
||||
func triggerAction( a:Action ):
|
||||
|
||||
if a == null:
|
||||
return
|
||||
|
||||
a.onTrigger()
|
|
@ -0,0 +1,13 @@
|
|||
class_name TriggerOnReady
|
||||
extends TriggerBase
|
||||
|
||||
|
||||
export(NodePath) var action
|
||||
|
||||
func _ready():
|
||||
triggerNodePath( action )
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
extends Node
|
||||
|
||||
func _ready() -> void:
|
||||
print("Loaded Music singleton")
|
||||
|
||||
var change_slow_actions : Array = []
|
||||
|
||||
func register_change_action(change_action : Node) -> void:
|
||||
print("Registered change action")
|
||||
change_slow_actions.append(change_action)
|
||||
|
||||
func unregister_change_action(change_action : Node) -> void:
|
||||
print("Unregistered change action")
|
||||
change_slow_actions.erase(change_action)
|
||||
|
||||
func change_music() -> void:
|
||||
for change_action in change_slow_actions:
|
||||
change_action.execute()
|
|
@ -0,0 +1,11 @@
|
|||
class_name MusicChangedSlowAction extends Node
|
||||
|
||||
func _ready():
|
||||
MusicSingleton.register_change_action(self)
|
||||
MusicSingleton.change_music()
|
||||
|
||||
func _exit_tree():
|
||||
MusicSingleton.unregister_change_action(self)
|
||||
|
||||
func execute() -> void:
|
||||
print("Executed OnMusicChangedSlowAction")
|
Loading…
Reference in New Issue