diff --git a/attribution.txt b/attribution.txt new file mode 100644 index 0000000..f9aaf0c --- /dev/null +++ b/attribution.txt @@ -0,0 +1,6 @@ +https://freesound.org/people/stomachache/sounds/53266/ +https://freesound.org/people/davidou/sounds/88449/ +https://freesound.org/people/DanJFilms/sounds/529388/ +https://freesound.org/people/InspectorJ/sounds/485420/ +https://freesound.org/people/deadrobotmusic/sounds/555462/ + diff --git a/godot/.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.md5 b/godot/.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.md5 new file mode 100644 index 0000000..8052b4f --- /dev/null +++ b/godot/.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.md5 @@ -0,0 +1,3 @@ +source_md5="3a305e912fa89b6c23353d1e33a1e67a" +dest_md5="181362e042d7c2be80ae2884c062bbaa" + diff --git a/godot/.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.oggstr b/godot/.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.oggstr new file mode 100644 index 0000000..841edce Binary files /dev/null and b/godot/.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.oggstr differ diff --git a/godot/.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.md5 b/godot/.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.md5 new file mode 100644 index 0000000..ca4c77e --- /dev/null +++ b/godot/.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.md5 @@ -0,0 +1,3 @@ +source_md5="ace676fe7e4f24bdbf032aa00230af74" +dest_md5="6221cf041bb9d666bad1929ab6455e8e" + diff --git a/godot/.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.oggstr b/godot/.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.oggstr new file mode 100644 index 0000000..9d05cb2 Binary files /dev/null and b/godot/.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.oggstr differ diff --git a/godot/.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.md5 b/godot/.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.md5 new file mode 100644 index 0000000..bca35eb --- /dev/null +++ b/godot/.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.md5 @@ -0,0 +1,3 @@ +source_md5="1d4ca3067ebf1c9e78e1186dc7d2bdf9" +dest_md5="a36af739bfbe7506149dbdeb9222249b" + diff --git a/godot/.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.oggstr b/godot/.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.oggstr new file mode 100644 index 0000000..b686397 Binary files /dev/null and b/godot/.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.oggstr differ diff --git a/godot/.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.md5 b/godot/.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.md5 new file mode 100644 index 0000000..c9d7eb2 --- /dev/null +++ b/godot/.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.md5 @@ -0,0 +1,3 @@ +source_md5="0796e1c356c44061f1585c69c4268e53" +dest_md5="d61ae818bf5cc83a29ef281a4864eb98" + diff --git a/godot/.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.oggstr b/godot/.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.oggstr new file mode 100644 index 0000000..29d2779 Binary files /dev/null and b/godot/.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.oggstr differ diff --git a/godot/.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.md5 b/godot/.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.md5 new file mode 100644 index 0000000..43b7556 --- /dev/null +++ b/godot/.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.md5 @@ -0,0 +1,3 @@ +source_md5="3b00d19524f66139ff9ed8d84a086ee3" +dest_md5="249c8e0d07c178efeb21032a31e2ed07" + diff --git a/godot/.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.oggstr b/godot/.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.oggstr new file mode 100644 index 0000000..e4f999f Binary files /dev/null and b/godot/.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.oggstr differ diff --git a/godot/assets/audio/walkie_talkie/buzz_static.ogg b/godot/assets/audio/walkie_talkie/buzz_static.ogg new file mode 100644 index 0000000..c8cef44 --- /dev/null +++ b/godot/assets/audio/walkie_talkie/buzz_static.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c417d7f94a55031ecaf6e72cc45bf4d6ef59c6ee0b446b8724c6ffaddae96de +size 82489 diff --git a/godot/assets/audio/walkie_talkie/buzz_static.ogg.import b/godot/assets/audio/walkie_talkie/buzz_static.ogg.import new file mode 100644 index 0000000..83a24bf --- /dev/null +++ b/godot/assets/audio/walkie_talkie/buzz_static.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.oggstr" + +[deps] + +source_file="res://assets/audio/walkie_talkie/buzz_static.ogg" +dest_files=[ "res://.import/buzz_static.ogg-0b07e5f14753859848a9c30f5b291e46.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/godot/assets/audio/walkie_talkie/high_whale.ogg b/godot/assets/audio/walkie_talkie/high_whale.ogg new file mode 100644 index 0000000..6573165 --- /dev/null +++ b/godot/assets/audio/walkie_talkie/high_whale.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:363c573040154613ebb6c33781ebc8dc1a14af05b9f9a73b44d193c542b5f908 +size 54902 diff --git a/godot/assets/audio/walkie_talkie/high_whale.ogg.import b/godot/assets/audio/walkie_talkie/high_whale.ogg.import new file mode 100644 index 0000000..45b34c4 --- /dev/null +++ b/godot/assets/audio/walkie_talkie/high_whale.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.oggstr" + +[deps] + +source_file="res://assets/audio/walkie_talkie/high_whale.ogg" +dest_files=[ "res://.import/high_whale.ogg-48d354f55ee014cb0a5286b1f3370c6c.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/godot/assets/audio/walkie_talkie/low_whale_one.ogg b/godot/assets/audio/walkie_talkie/low_whale_one.ogg new file mode 100644 index 0000000..59c39cb --- /dev/null +++ b/godot/assets/audio/walkie_talkie/low_whale_one.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12e35580303026ed460147b3cbca82ded351fe6cb4d7439ff54b81de97b91f4d +size 68211 diff --git a/godot/assets/audio/walkie_talkie/low_whale_one.ogg.import b/godot/assets/audio/walkie_talkie/low_whale_one.ogg.import new file mode 100644 index 0000000..93fc0fa --- /dev/null +++ b/godot/assets/audio/walkie_talkie/low_whale_one.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.oggstr" + +[deps] + +source_file="res://assets/audio/walkie_talkie/low_whale_one.ogg" +dest_files=[ "res://.import/low_whale_one.ogg-a0d08574bcb169191faa5efc68b2178c.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/godot/assets/audio/walkie_talkie/talk.ogg b/godot/assets/audio/walkie_talkie/talk.ogg new file mode 100644 index 0000000..2c6bd9e --- /dev/null +++ b/godot/assets/audio/walkie_talkie/talk.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6da81ff5cee3b355cfa6db287bcc20e9d329b3224ff2c82cbee9c1040f90b47e +size 207196 diff --git a/godot/assets/audio/walkie_talkie/talk.ogg.import b/godot/assets/audio/walkie_talkie/talk.ogg.import new file mode 100644 index 0000000..a741ae9 --- /dev/null +++ b/godot/assets/audio/walkie_talkie/talk.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.oggstr" + +[deps] + +source_file="res://assets/audio/walkie_talkie/talk.ogg" +dest_files=[ "res://.import/talk.ogg-abea439d59f87a9e2ac7d961d89b3f90.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/godot/assets/audio/walkie_talkie/white_noise_static.ogg b/godot/assets/audio/walkie_talkie/white_noise_static.ogg new file mode 100644 index 0000000..f402ea9 --- /dev/null +++ b/godot/assets/audio/walkie_talkie/white_noise_static.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba6a1b3606df4d29e200c20eed3332484568b521a72de32cee81946841056458 +size 2611646 diff --git a/godot/assets/audio/walkie_talkie/white_noise_static.ogg.import b/godot/assets/audio/walkie_talkie/white_noise_static.ogg.import new file mode 100644 index 0000000..7e69f2d --- /dev/null +++ b/godot/assets/audio/walkie_talkie/white_noise_static.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.oggstr" + +[deps] + +source_file="res://assets/audio/walkie_talkie/white_noise_static.ogg" +dest_files=[ "res://.import/white_noise_static.ogg-eaabccf998e61660a6b2b735e6fefe29.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/godot/assets/models/walkie_talkie/LCDScreen.material b/godot/assets/models/walkie_talkie/LCDScreen.material index 0f92f26..6bb1896 100644 --- a/godot/assets/models/walkie_talkie/LCDScreen.material +++ b/godot/assets/models/walkie_talkie/LCDScreen.material @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:95243f6109f32ed5d0346ec0112c0ad2ea0f688e71c47b37f76cbd334db63d3e -size 847 +oid sha256:eb4f20f3ec3c7375db932749187dabaec8d02a3aa5dd4d010281cad22d8fea73 +size 835 diff --git a/godot/assets/models/walkie_talkie/walkie_talkie.gd b/godot/assets/models/walkie_talkie/walkie_talkie.gd index ebcc023..78b4d2b 100644 --- a/godot/assets/models/walkie_talkie/walkie_talkie.gd +++ b/godot/assets/models/walkie_talkie/walkie_talkie.gd @@ -2,13 +2,56 @@ extends Spatial var active = false onready var fsm: AnimationNodeStateMachinePlayback = $Animations/AnimationTree.get("parameters/playback") +export var default_screen_color = Color(226, 255, 0, 255) +export var screen_off_color = Color(0.0, 0.0, 0.0) +var is_screen_on: bool +# Screen flicker is buggy it glitches and does new things when you modify the albedo colour +# Seems like a Godot bug + +func _ready(): + is_screen_on = false + turn_screen_off() + +func turn_screen_off(): + var mat = $Animations/walkie_talkie/Body.get_active_material(1) + #mat.albedo_color = screen_off_color + #mat.emission_enabled = false + is_screen_on = false + +func turn_screen_on(): + var mat = $Animations/walkie_talkie/Body.get_active_material(1) + #mat.albedo_color = default_screen_color + #mat.emission_enabled = true + is_screen_on = true + +func toggle_screen(): + if is_screen_on: + turn_screen_off() + else: + turn_screen_on() func toggle(): if active: fsm.travel("WalkieTalkieLeave") + $StaticBuzz.stop() + $StaticFizz.stop() + $Talk.stop() + $Whale1.stop() + $Whale2.stop() + turn_screen_off() else: - fsm.start("WalkieTalkieEnter") + if fsm.is_playing(): + fsm.travel("WalkieTalkieEnter") + else: + fsm.start("WalkieTalkieEnter") + $StaticBuzz.play() + $StaticFizz.play() + $Talk.play() + $Whale1.play() + $Whale2.play() + turn_screen_on() + active = not active func put_away(): @@ -19,3 +62,8 @@ func put_away(): func _process(_delta): if Input.is_action_just_pressed("toggle_walkie_talkie"): toggle() + + +func _on_ScreenFlicker_timeout(): + if active: + toggle_screen() diff --git a/godot/assets/models/walkie_talkie/walkie_talkie.tscn b/godot/assets/models/walkie_talkie/walkie_talkie.tscn index 5ec9002..241bc23 100644 --- a/godot/assets/models/walkie_talkie/walkie_talkie.tscn +++ b/godot/assets/models/walkie_talkie/walkie_talkie.tscn @@ -1,10 +1,15 @@ -[gd_scene load_steps=26 format=2] +[gd_scene load_steps=33 format=2] [ext_resource path="res://assets/models/walkie_talkie/LCDScreen.material" type="Material" id=1] [ext_resource path="res://assets/models/walkie_talkie/WalkieTalkieSpeaker.material" type="Material" id=2] [ext_resource path="res://assets/models/walkie_talkie/MetalBody.material" type="Material" id=3] [ext_resource path="res://assets/models/walkie_talkie/WalkieTalkieKnob.material" type="Material" id=4] [ext_resource path="res://assets/models/walkie_talkie/walkie_talkie.gd" type="Script" id=5] +[ext_resource path="res://assets/audio/walkie_talkie/low_whale_one.ogg" type="AudioStream" id=6] +[ext_resource path="res://assets/audio/walkie_talkie/buzz_static.ogg" type="AudioStream" id=7] +[ext_resource path="res://assets/audio/walkie_talkie/white_noise_static.ogg" type="AudioStream" id=8] +[ext_resource path="res://assets/audio/walkie_talkie/talk.ogg" type="AudioStream" id=9] +[ext_resource path="res://assets/audio/walkie_talkie/high_whale.ogg" type="AudioStream" id=10] [sub_resource type="Animation" id=1] resource_name = "WalkieTalkieEnter" @@ -80,17 +85,23 @@ xfade_time = 0.5 [sub_resource type="AnimationNodeStateMachineTransition" id=33] xfade_time = 0.5 +[sub_resource type="AnimationNodeStateMachineTransition" id=34] +xfade_time = 0.1 + +[sub_resource type="AnimationNodeStateMachineTransition" id=35] +xfade_time = 0.1 + [sub_resource type="AnimationNodeStateMachine" id=18] states/WalkieTalkieEnter/node = SubResource( 24 ) -states/WalkieTalkieEnter/position = Vector2( 183, 294 ) +states/WalkieTalkieEnter/position = Vector2( 184, 280 ) states/WalkieTalkieIdle/node = SubResource( 25 ) states/WalkieTalkieIdle/position = Vector2( 380, 113 ) states/WalkieTalkieLeave/node = SubResource( 26 ) states/WalkieTalkieLeave/position = Vector2( 123, -28 ) states/WalkieTalkieWalking/node = SubResource( 27 ) states/WalkieTalkieWalking/position = Vector2( 681, 113 ) -transitions = [ "WalkieTalkieEnter", "WalkieTalkieIdle", SubResource( 28 ), "WalkieTalkieIdle", "WalkieTalkieWalking", SubResource( 29 ), "WalkieTalkieWalking", "WalkieTalkieIdle", SubResource( 30 ), "WalkieTalkieIdle", "WalkieTalkieLeave", SubResource( 32 ), "WalkieTalkieWalking", "WalkieTalkieLeave", SubResource( 33 ) ] -graph_offset = Vector2( -160, -215 ) +transitions = [ "WalkieTalkieEnter", "WalkieTalkieIdle", SubResource( 28 ), "WalkieTalkieIdle", "WalkieTalkieWalking", SubResource( 29 ), "WalkieTalkieWalking", "WalkieTalkieIdle", SubResource( 30 ), "WalkieTalkieIdle", "WalkieTalkieLeave", SubResource( 32 ), "WalkieTalkieWalking", "WalkieTalkieLeave", SubResource( 33 ), "WalkieTalkieLeave", "WalkieTalkieEnter", SubResource( 34 ), "WalkieTalkieEnter", "WalkieTalkieLeave", SubResource( 35 ) ] +graph_offset = Vector2( -167, -115 ) [sub_resource type="AnimationNodeStateMachinePlayback" id=19] @@ -239,7 +250,31 @@ light_specular = 1.5 light_cull_mask = 4293919232 omni_range = 0.449905 +[node name="ScreenFlicker" type="Timer" parent="Animations/walkie_talkie/Body"] +wait_time = 0.5 +autostart = true + [node name="BigKnob" type="MeshInstance" parent="Animations/walkie_talkie"] transform = Transform( 0.162289, -0.107564, 5.80247e-09, -5.80247e-09, -2.32099e-08, -0.194699, 0.107564, 0.162289, -2.32099e-08, 0.546791, 0.656719, -2.05382 ) layers = 512 mesh = SubResource( 23 ) + +[node name="StaticBuzz" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 7 ) +volume_db = 8.211 + +[node name="StaticFizz" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 8 ) +volume_db = 4.789 + +[node name="Talk" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 9 ) +volume_db = 3.421 + +[node name="Whale1" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 6 ) + +[node name="Whale2" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 10 ) + +[connection signal="timeout" from="Animations/walkie_talkie/Body/ScreenFlicker" to="." method="_on_ScreenFlicker_timeout"]