@@ -0,0 +1,3 @@ | |||
source_md5="46fbf6805e08cb6849da372142616004" | |||
dest_md5="e3ffdf1efc23d39f58ec547ccf1f22e2" | |||
@@ -0,0 +1,3 @@ | |||
source_md5="9e6a5db548a8dcb68eaf7a61f5306be0" | |||
dest_md5="888d8a15176062672504ce8798441c32" | |||
@@ -0,0 +1,3 @@ | |||
source_md5="f0743de1cdb38cc41380a7d43356a333" | |||
dest_md5="617415b36dd7764c9c8056ad6202a961" | |||
@@ -0,0 +1,22 @@ | |||
[gd_scene load_steps=4 format=2] | |||
[ext_resource path="res://Data/Scripts/BladeSaw.gd" type="Script" id=1] | |||
[ext_resource path="res://Data/Graphics/nstar.png" type="Texture" id=2] | |||
[ext_resource path="res://Data/Sound/Effects/saw.wav" type="AudioStream" id=3] | |||
[node name="BladeSaw" type="KinematicBody2D"] | |||
collision_layer = 2 | |||
script = ExtResource( 1 ) | |||
degrees_per_second = 270.0 | |||
[node name="audio" type="AudioStreamPlayer2D" parent="."] | |||
stream = ExtResource( 3 ) | |||
max_distance = 512.0 | |||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] | |||
position = Vector2( 0.291977, -0.407814 ) | |||
polygon = PoolVector2Array( -0.190857, -62.8828, 15.1022, -32.9085, 45.8921, -43.1038, 35.9007, -11.7022, 63.632, 2.77521, 33.6577, 17.4565, 43.2413, 46.2074, 13.4709, 37.2355, 0.0130463, 63.9473, -13.8526, 37.4394, -43.623, 46.6152, -34.0394, 17.8643, -64.0137, 2.5713, -36.0785, -11.4983, -47.0894, -43.3077, -15.4839, -32.9085 ) | |||
[node name="Sprite" type="Sprite" parent="."] | |||
modulate = Color( 0.705882, 0.705882, 0.705882, 1 ) | |||
texture = ExtResource( 2 ) |
@@ -1,15 +1,18 @@ | |||
[gd_scene load_steps=8 format=2] | |||
[gd_scene load_steps=9 format=2] | |||
[ext_resource path="res://Data/Objects/PulseArrow.tscn" type="PackedScene" id=1] | |||
[ext_resource path="res://Data/Objects/Player.tscn" type="PackedScene" id=2] | |||
[ext_resource path="res://Data/Objects/Liquid.tscn" type="PackedScene" id=3] | |||
[ext_resource path="res://Data/Graphics/placeholder.png" type="Texture" id=4] | |||
[ext_resource path="res://Data/Scripts/BladeSaw.gd" type="Script" id=5] | |||
[ext_resource path="res://Data/Graphics/nstar.png" type="Texture" id=6] | |||
[ext_resource path="res://Data/Objects/BladeSaw.tscn" type="PackedScene" id=5] | |||
[ext_resource path="res://Data/Toggler.gd" type="Script" id=6] | |||
[sub_resource type="RectangleShape2D" id=1] | |||
extents = Vector2( 32, 32 ) | |||
[sub_resource type="RectangleShape2D" id=2] | |||
extents = Vector2( 32, 32 ) | |||
[node name="World" type="Node2D"] | |||
[node name="Player" parent="." instance=ExtResource( 2 )] | |||
@@ -90,16 +93,18 @@ position = Vector2( 250.511, 119.095 ) | |||
scale = Vector2( 0.1, 0.1 ) | |||
pulse_color = Color( 0.356863, 0.960784, 0.211765, 1 ) | |||
[node name="BladeSaw" type="KinematicBody2D" parent="."] | |||
position = Vector2( 252.7, 41.8 ) | |||
collision_layer = 2 | |||
script = ExtResource( 5 ) | |||
degrees_per_second = 180.0 | |||
active = false | |||
[node name="BladeSaw" parent="." instance=ExtResource( 5 )] | |||
position = Vector2( 271.339, 28.5271 ) | |||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BladeSaw"] | |||
position = Vector2( 0.291977, -0.407814 ) | |||
polygon = PoolVector2Array( -0.190857, -62.8828, 15.1022, -32.9085, 45.8921, -43.1038, 35.9007, -11.7022, 63.632, 2.77521, 33.6577, 17.4565, 43.2413, 46.2074, 13.4709, 37.2355, 0.0130463, 63.9473, -13.8526, 37.4394, -43.623, 46.6152, -34.0394, 17.8643, -64.0137, 2.5713, -36.0785, -11.4983, -47.0894, -43.3077, -15.4839, -32.9085 ) | |||
[node name="Toggler" type="Node2D" parent="."] | |||
script = ExtResource( 6 ) | |||
[node name="Sprite" type="Sprite" parent="BladeSaw"] | |||
texture = ExtResource( 6 ) | |||
[node name="Area2D" type="Area2D" parent="Toggler"] | |||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Toggler/Area2D"] | |||
shape = SubResource( 2 ) | |||
[node name="Sprite" type="Sprite" parent="Toggler"] | |||
modulate = Color( 0.996078, 0.815686, 0.815686, 1 ) | |||
texture = ExtResource( 4 ) | |||
[connection signal="body_entered" from="Toggler/Area2D" to="Toggler" method="_on_Area2D_body_entered"] |
@@ -10,6 +10,9 @@ var _easing_out = false | |||
var _easing = 0.0 | |||
var _running = false | |||
var _volume_on = 0 | |||
var _pitch_on = 1.0 | |||
func _set_active(b): | |||
if active != b: | |||
@@ -23,6 +26,8 @@ func _set_active(b): | |||
# Called when the node enters the scene tree for the first time. | |||
func _ready(): | |||
_volume_on = $audio.volume_db | |||
_pitch_on = $audio.pitch_scale | |||
set_physics_process(true) | |||
if active and _easing == 0.0: | |||
_running = true | |||
@@ -35,13 +40,26 @@ func _physics_process(delta): | |||
_easing_in = false | |||
_easing_out = false | |||
_easing = 0.0 | |||
if not _running: | |||
$audio.stop() | |||
$audio.volume_db = _volume_on | |||
$audio.pitch_scale = _pitch_on | |||
else: | |||
if not $audio.playing: | |||
$audio.play() | |||
var adj | |||
var vol | |||
if _easing_in: | |||
adj = 1.0 - (_easing / ease_in) | |||
vol = adj | |||
else: | |||
adj = 1.0 - (_easing / ease_out) | |||
vol = (_easing / ease_out) | |||
adj = vol | |||
$audio.volume_db = (-80 + ((_volume_on + 80) * vol)) | |||
$audio.pitch_scale = 0.1 + ((_pitch_on - 0.1) * vol) | |||
rotate(deg2rad(degrees_per_second * adj * delta)) | |||
if _running: | |||
elif _running: | |||
if not $audio.playing: | |||
$audio.play() | |||
rotate(deg2rad(degrees_per_second * delta)) | |||
@@ -28,8 +28,6 @@ func _set_pulse_offset(v): | |||
material.set_shader_param("fade_offset", _camp(v, 0.1, 0.5)) | |||
func _get_pulse_offset(): | |||
if self.get_name() == "Dot21": | |||
print("PING") | |||
return _ramp(material.get_shader_param("fade_offset"), 0.1, 0.5) | |||
func _set_pulse_color(c): |
@@ -0,0 +1,12 @@ | |||
The following are the sound effects/music and the places in which they were obtained... | |||
Effects/click.wav | |||
https://freesound.org/people/OtisJames/sounds/215772/ | |||
Effects/generator1.wav | |||
https://freesound.org/people/HerbertBoland/sounds/114594/ | |||
Effects/saw.wav | |||
https://freesound.org/people/Marregheriti/sounds/266104/ | |||
@@ -0,0 +1,21 @@ | |||
[remap] | |||
importer="wav" | |||
type="AudioStreamSample" | |||
path="res://.import/click.wav-15f0a8bac0191e01d61291a7ee455683.sample" | |||
[deps] | |||
source_file="res://Data/Sound/Effects/click.wav" | |||
dest_files=[ "res://.import/click.wav-15f0a8bac0191e01d61291a7ee455683.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 |
@@ -0,0 +1,21 @@ | |||
[remap] | |||
importer="wav" | |||
type="AudioStreamSample" | |||
path="res://.import/generator1.wav-7c89107f0246adc6370d751013550dff.sample" | |||
[deps] | |||
source_file="res://Data/Sound/Effects/generator1.wav" | |||
dest_files=[ "res://.import/generator1.wav-7c89107f0246adc6370d751013550dff.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 |
@@ -0,0 +1,21 @@ | |||
[remap] | |||
importer="wav" | |||
type="AudioStreamSample" | |||
path="res://.import/saw.wav-4d391556f8ccb707f189b4b5bb477e2e.sample" | |||
[deps] | |||
source_file="res://Data/Sound/Effects/saw.wav" | |||
dest_files=[ "res://.import/saw.wav-4d391556f8ccb707f189b4b5bb477e2e.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=true | |||
compress/mode=0 |
@@ -0,0 +1,8 @@ | |||
extends Node2D | |||
func _on_Area2D_body_entered(body): | |||
var bs = get_parent().get_node("BladeSaw") | |||
bs.active = !bs.active |
@@ -0,0 +1,9 @@ | |||
[gd_resource type="AudioBusLayout" format=2] | |||
[resource] | |||
bus/1/name = "Effects" | |||
bus/1/solo = false | |||
bus/1/mute = false | |||
bus/1/bypass_fx = false | |||
bus/1/volume_db = 0.0 | |||
bus/1/send = "Master" |