| @@ -31,13 +31,14 @@ void fragment(){ | |||
| [sub_resource type="ShaderMaterial" id=1] | |||
| resource_local_to_scene = true | |||
| shader = SubResource( 2 ) | |||
| shader_param/primary_color = Color( 1, 0.8, 0, 1 ) | |||
| shader_param/fade_offset = 0.15 | |||
| shader_param/primary_color = Color( 0, 0, 0, 1 ) | |||
| shader_param/fade_offset = 0.14 | |||
| [node name="Glowdot" type="Sprite"] | |||
| material = SubResource( 1 ) | |||
| texture = ExtResource( 1 ) | |||
| script = ExtResource( 2 ) | |||
| pulse_offset = 0.1 | |||
| [node name="Pulse" type="Tween" parent="."] | |||
| @@ -8,8 +8,8 @@ | |||
| [sub_resource type="ShaderMaterial" id=1] | |||
| resource_local_to_scene = true | |||
| shader = ExtResource( 3 ) | |||
| shader_param/primary_color = Color( 1, 0.8, 0, 1 ) | |||
| shader_param/fade_offset = 0.15 | |||
| shader_param/primary_color = Color( 0, 0, 0, 1 ) | |||
| shader_param/fade_offset = 0.14 | |||
| [sub_resource type="RectangleShape2D" id=2] | |||
| extents = Vector2( 24, 7 ) | |||
| @@ -49,6 +49,7 @@ material = SubResource( 1 ) | |||
| position = Vector2( 14.989, -0.323532 ) | |||
| scale = Vector2( 0.25, 0.25 ) | |||
| pulse_in_time = 0.2 | |||
| pulse_offset = 0.1 | |||
| [node name="CollisionShape2D" type="CollisionShape2D" parent="Doorway"] | |||
| shape = SubResource( 2 ) | |||
| @@ -4,7 +4,7 @@ | |||
| [ext_resource path="res://Data/Graphics/placeholder.png" type="Texture" id=2] | |||
| [ext_resource path="res://Data/Shaders/Liquid.shader" type="Shader" id=3] | |||
| [sub_resource type="ShaderMaterial" id=7] | |||
| [sub_resource type="ShaderMaterial" id=1] | |||
| resource_local_to_scene = true | |||
| shader = ExtResource( 3 ) | |||
| shader_param/sprite_scale = Vector2( 2.96, 1 ) | |||
| @@ -40,7 +40,7 @@ scale_curve = SubResource( 4 ) | |||
| color = Color( 0.576471, 0.760784, 0.996078, 1 ) | |||
| [node name="Liquid" type="Sprite"] | |||
| material = SubResource( 7 ) | |||
| material = SubResource( 1 ) | |||
| texture = ExtResource( 2 ) | |||
| script = ExtResource( 1 ) | |||
| @@ -32,31 +32,31 @@ void fragment(){ | |||
| resource_local_to_scene = true | |||
| shader = SubResource( 1 ) | |||
| shader_param/primary_color = Color( 1, 0.8, 0, 1 ) | |||
| shader_param/fade_offset = 0.15 | |||
| shader_param/fade_offset = 0.14 | |||
| [sub_resource type="ShaderMaterial" id=3] | |||
| resource_local_to_scene = true | |||
| shader = SubResource( 1 ) | |||
| shader_param/primary_color = Color( 1, 0.8, 0, 1 ) | |||
| shader_param/fade_offset = 0.15 | |||
| shader_param/fade_offset = 0.24 | |||
| [sub_resource type="ShaderMaterial" id=4] | |||
| resource_local_to_scene = true | |||
| shader = SubResource( 1 ) | |||
| shader_param/primary_color = Color( 1, 0.8, 0, 1 ) | |||
| shader_param/fade_offset = 0.15 | |||
| shader_param/fade_offset = 0.34 | |||
| [sub_resource type="ShaderMaterial" id=5] | |||
| resource_local_to_scene = true | |||
| shader = SubResource( 1 ) | |||
| shader_param/primary_color = Color( 1, 0.8, 0, 1 ) | |||
| shader_param/fade_offset = 0.15 | |||
| shader_param/fade_offset = 0.24 | |||
| [sub_resource type="ShaderMaterial" id=6] | |||
| resource_local_to_scene = true | |||
| shader = SubResource( 1 ) | |||
| shader_param/primary_color = Color( 1, 0.8, 0, 1 ) | |||
| shader_param/fade_offset = 0.15 | |||
| shader_param/fade_offset = 0.34 | |||
| [node name="PulseArrow" type="Node2D"] | |||
| script = ExtResource( 1 ) | |||
| @@ -64,28 +64,34 @@ script = ExtResource( 1 ) | |||
| [node name="Dot" parent="." instance=ExtResource( 3 )] | |||
| material = SubResource( 2 ) | |||
| position = Vector2( 0, -0.698334 ) | |||
| pulse_color = Color( 1, 0.8, 0, 1 ) | |||
| pulse_out = 0.75 | |||
| pulse_offset = 0.1 | |||
| [node name="Dot21" parent="." instance=ExtResource( 3 )] | |||
| material = SubResource( 3 ) | |||
| position = Vector2( -53.772, 35.6152 ) | |||
| pulse_color = Color( 1, 0.8, 0, 1 ) | |||
| pulse_out = 0.75 | |||
| pulse_offset = 0.35 | |||
| [node name="Dot31" parent="." instance=ExtResource( 3 )] | |||
| material = SubResource( 4 ) | |||
| position = Vector2( -110.337, 66.3421 ) | |||
| pulse_color = Color( 1, 0.8, 0, 1 ) | |||
| pulse_out = 0.75 | |||
| pulse_offset = 0.6 | |||
| [node name="Dot22" parent="." instance=ExtResource( 3 )] | |||
| material = SubResource( 5 ) | |||
| position = Vector2( 52.3753, 35.6152 ) | |||
| pulse_color = Color( 1, 0.8, 0, 1 ) | |||
| pulse_out = 0.75 | |||
| pulse_offset = 0.35 | |||
| [node name="Dot32" parent="." instance=ExtResource( 3 )] | |||
| material = SubResource( 6 ) | |||
| position = Vector2( 106.147, 66.3421 ) | |||
| pulse_color = Color( 1, 0.8, 0, 1 ) | |||
| pulse_out = 0.75 | |||
| pulse_offset = 0.6 | |||
| @@ -17,6 +17,7 @@ angle = 45.0 | |||
| angle_random = 0.25 | |||
| scale = 1.5 | |||
| scale_random = 0.5 | |||
| color = Color( 0.980392, 0.980392, 0.74902, 1 ) | |||
| [sub_resource type="RectangleShape2D" id=2] | |||
| extents = Vector2( 40, 40 ) | |||
| @@ -24,44 +25,47 @@ extents = Vector2( 40, 40 ) | |||
| [node name="Pusher" type="Node2D"] | |||
| script = ExtResource( 1 ) | |||
| [node name="PulseArrow1" parent="." instance=ExtResource( 2 )] | |||
| [node name="Body" type="Position2D" parent="."] | |||
| [node name="PulseArrow1" parent="Body" instance=ExtResource( 2 )] | |||
| position = Vector2( -18, -18.0497 ) | |||
| scale = Vector2( 0.1, 0.1 ) | |||
| pulse_color = Color( 0.356863, 0.960784, 0.211765, 1 ) | |||
| pulse_color = Color( 1, 1, 1, 1 ) | |||
| [node name="PulseArrow2" parent="." instance=ExtResource( 2 )] | |||
| [node name="PulseArrow2" parent="Body" instance=ExtResource( 2 )] | |||
| position = Vector2( -18, -4.04972 ) | |||
| scale = Vector2( 0.1, 0.1 ) | |||
| pulse_color = Color( 0.356863, 0.960784, 0.211765, 1 ) | |||
| pulse_color = Color( 1, 1, 1, 1 ) | |||
| [node name="PulseArrow3" parent="." instance=ExtResource( 2 )] | |||
| [node name="PulseArrow3" parent="Body" instance=ExtResource( 2 )] | |||
| position = Vector2( -18, 9.95028 ) | |||
| scale = Vector2( 0.1, 0.1 ) | |||
| pulse_color = Color( 0.356863, 0.960784, 0.211765, 1 ) | |||
| pulse_color = Color( 1, 1, 1, 1 ) | |||
| [node name="PulseArrow6" parent="." instance=ExtResource( 2 )] | |||
| [node name="PulseArrow6" parent="Body" instance=ExtResource( 2 )] | |||
| position = Vector2( 18, -18.0497 ) | |||
| scale = Vector2( 0.1, 0.1 ) | |||
| pulse_color = Color( 0.356863, 0.960784, 0.211765, 1 ) | |||
| pulse_color = Color( 1, 1, 1, 1 ) | |||
| [node name="PulseArrow5" parent="." instance=ExtResource( 2 )] | |||
| [node name="PulseArrow5" parent="Body" instance=ExtResource( 2 )] | |||
| position = Vector2( 18, -4.04972 ) | |||
| scale = Vector2( 0.1, 0.1 ) | |||
| pulse_color = Color( 0.356863, 0.960784, 0.211765, 1 ) | |||
| pulse_color = Color( 1, 1, 1, 1 ) | |||
| [node name="PulseArrow4" parent="." instance=ExtResource( 2 )] | |||
| [node name="PulseArrow4" parent="Body" instance=ExtResource( 2 )] | |||
| position = Vector2( 18, 9.95028 ) | |||
| scale = Vector2( 0.1, 0.1 ) | |||
| pulse_color = Color( 0.356863, 0.960784, 0.211765, 1 ) | |||
| pulse_color = Color( 1, 1, 1, 1 ) | |||
| [node name="Particles2D" type="Particles2D" parent="."] | |||
| [node name="Particles" type="Particles2D" parent="Body"] | |||
| position = Vector2( 0, 40.5267 ) | |||
| amount = 20 | |||
| process_material = SubResource( 1 ) | |||
| [node name="Area2D" type="Area2D" parent="."] | |||
| [node name="Area2D" type="Area2D" parent="Body"] | |||
| visible = false | |||
| [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] | |||
| [node name="CollisionShape2D" type="CollisionShape2D" parent="Body/Area2D"] | |||
| shape = SubResource( 2 ) | |||
| [connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"] | |||
| [connection signal="body_exited" from="Area2D" to="." method="_on_Area2D_body_exited"] | |||
| [connection signal="body_entered" from="Body/Area2D" to="." method="_on_Area2D_body_entered"] | |||
| [connection signal="body_exited" from="Body/Area2D" to="." method="_on_Area2D_body_exited"] | |||
| @@ -38,7 +38,7 @@ shader_param/wave_scale = 1.0 | |||
| material = SubResource( 1 ) | |||
| position = Vector2( -127.435, 105.962 ) | |||
| scale = Vector2( 2.35979, 1.50659 ) | |||
| liquid_body_color = Color( 0.517647, 0.145098, 0.145098, 1 ) | |||
| liquid_body_color = Color( 0.513726, 0.137255, 0.137255, 1 ) | |||
| liquid_surface_color = Color( 0.984314, 0.478431, 0.490196, 1 ) | |||
| [node name="Liquid" parent="." instance=ExtResource( 3 )] | |||
| @@ -66,7 +66,9 @@ degrees_per_second = -270.0 | |||
| [node name="Pusher" parent="." instance=ExtResource( 1 )] | |||
| position = Vector2( 108.94, -32.8218 ) | |||
| pulse_color = Color( 0.0941176, 0.156863, 0.815686, 1 ) | |||
| pulse_color = Color( 0.980392, 0.980392, 0.74902, 1 ) | |||
| push_force = 128.0 | |||
| push_angle = 34.923 | |||
| [node name="TileMap" type="TileMap" parent="."] | |||
| tile_set = ExtResource( 7 ) | |||
| @@ -53,6 +53,9 @@ func get_colors(): | |||
| "alt": $Sprite.material.get_shader_param("rim_color") | |||
| }; | |||
| func get_rim_color(): | |||
| return $Sprite.material.get_shader_param("rim_color") | |||
| func get_tangential_acceleration(): | |||
| return base_tangential_accel * $Mood.get_need() | |||
| @@ -1,3 +1,4 @@ | |||
| tool | |||
| extends Sprite | |||
| const TRANS = Tween.TRANS_LINEAR | |||
| @@ -1,23 +1,19 @@ | |||
| #tool | |||
| tool | |||
| extends Sprite | |||
| export var liquid_body_color:Color setget _set_liquid_body_color, _get_liquid_body_color | |||
| export var liquid_surface_color:Color setget _set_liquid_surface_color, _get_liquid_surface_color | |||
| export var liquid_body_color:Color setget _set_liquid_body_color | |||
| export var liquid_surface_color:Color setget _set_liquid_surface_color | |||
| func _set_liquid_body_color(c): | |||
| liquid_body_color = c | |||
| material.set_shader_param("liquid_color_main", c) | |||
| func _get_liquid_body_color(): | |||
| return material.get_shader_param("liquid_color_main") | |||
| func _set_liquid_surface_color(c): | |||
| liquid_surface_color = c | |||
| material.set_shader_param("liquid_color_surface", c) | |||
| $Splash.process_material.color = c | |||
| func _get_liquid_surface_color(): | |||
| return material.get_shader_param("liquid_color_surface") | |||
| func _ready(): | |||
| material.set_shader_param("sprite_scale", scale) | |||
| #$Splash.process_material.color = material.get_shader_param("liquid_color_surface") | |||
| @@ -1,8 +1,17 @@ | |||
| tool | |||
| extends Node2D | |||
| export var pulse_color:Color = Color(1.0, 0.8, 0.0, 1.0) | |||
| export var pulse_color:Color = Color(1.0, 0.8, 0.0, 1.0) setget _set_color | |||
| func _set_color(c): | |||
| pulse_color = c | |||
| $Dot.pulse_color = c | |||
| $Dot21.pulse_color = c | |||
| $Dot22.pulse_color = c | |||
| $Dot31.pulse_color = c | |||
| $Dot32.pulse_color = c | |||
| func _ready(): | |||
| set_color(pulse_color) | |||
| $Dot.start() | |||
| @@ -12,10 +21,5 @@ func _ready(): | |||
| $Dot32.start() | |||
| func set_color(c): | |||
| pulse_color = c | |||
| $Dot.pulse_color = c | |||
| $Dot21.pulse_color = c | |||
| $Dot22.pulse_color = c | |||
| $Dot31.pulse_color = c | |||
| $Dot32.pulse_color = c | |||
| _set_color(c) | |||
| @@ -1,37 +1,47 @@ | |||
| tool | |||
| extends Node2D | |||
| const PUSH_VEC_DEFAULT = Vector2(0.0, -1.0) | |||
| export var pulse_color:Color = Color(1.0, 1.0, 1.0, 1.0) | |||
| export var pulse_color:Color = Color(1.0, 1.0, 1.0, 1.0) setget _set_color | |||
| export(float, 0, 400) var push_force = 128 | |||
| export(float, 0, 1.0) var push_frequency = 0.2 | |||
| export(float, -180.0, 180) var push_angle = 0 | |||
| export(float, -180.0, 180) var push_angle = 0 setget _set_angle | |||
| var _bodies = [] | |||
| var _delay = 1.1 | |||
| func _dominant_color(): | |||
| if pulse_color.r > pulse_color.g and pulse_color.r > pulse_color.b: | |||
| func _set_angle(a): | |||
| push_angle = a | |||
| $Body.rotation_degrees = push_angle | |||
| func _set_color(c): | |||
| pulse_color = c | |||
| for i in range(6): | |||
| get_node("Body/PulseArrow" + String(i + 1)).set_color(pulse_color) | |||
| $Body/Particles.process_material.color = c | |||
| func _dominant_color(c): | |||
| if c.r > c.g and c.r > c.b: | |||
| return "r" | |||
| elif pulse_color.g > pulse_color.r and pulse_color.g > pulse_color.b: | |||
| elif c.g > c.r and c.g > c.b: | |||
| return "g" | |||
| elif pulse_color.b > pulse_color.r and pulse_color.b > pulse_color.g: | |||
| elif c.b > c.r and c.b > c.g: | |||
| return "b" | |||
| return "n" | |||
| func _ready(): | |||
| set_process(true) | |||
| for i in range(6): | |||
| get_node("PulseArrow" + String(i + 1)).set_color(pulse_color) | |||
| get_node("Body/PulseArrow" + String(i + 1)).set_color(pulse_color) | |||
| func _mood_match(body): | |||
| if body.has_method("get_mood"): | |||
| var mood = body.get_mood() | |||
| var dc = _dominant_color() | |||
| if (dc == "r" and mood.is_aggressive()) or \ | |||
| (dc == "g" and mood.is_needie()) or \ | |||
| (dc == "b" and mood.is_content()): | |||
| func _rim_match(body): | |||
| if body.has_method("get_rim_color"): | |||
| var rdc = _dominant_color(body.get_rim_color()) | |||
| var dc = _dominant_color(pulse_color) | |||
| print ("RIM: ", rdc, " | Push: ", dc) | |||
| if (rdc == dc): | |||
| return true | |||
| return false | |||
| @@ -40,7 +50,7 @@ func _process(delta): | |||
| _delay = 0.0 | |||
| var v = PUSH_VEC_DEFAULT.rotated(deg2rad(push_angle)) | |||
| for i in range(_bodies.size()): | |||
| if _mood_match(_bodies[i]): | |||
| if _rim_match(_bodies[i]): | |||
| _bodies[i].apply_central_impulse(v * push_force) | |||
| else: | |||
| _delay = min(1.1, _delay + delta) | |||