Compare commits
No commits in common. "1adf5b5ed7975935e1b8695af6f4b42200dca020" and "d42b370cdf90d4dabed8e8f0d2f542920a40d7cd" have entirely different histories.
1adf5b5ed7
...
d42b370cdf
21 changed files with 6 additions and 340 deletions
|
|
@ -1,21 +0,0 @@
|
|||
@tool
|
||||
class_name CurvedLabel
|
||||
extends Control
|
||||
|
||||
|
||||
@export var curve: Curve
|
||||
@export var text: String:
|
||||
set(new_value):
|
||||
text = new_value
|
||||
queue_redraw()
|
||||
@export var enable_rotation: bool = true:
|
||||
set(new_value):
|
||||
enable_rotation = new_value
|
||||
queue_redraw()
|
||||
|
||||
func _draw():
|
||||
var rotation = 0.0
|
||||
for i in text.length():
|
||||
draw_char(get_theme_default_font(), Vector2.ZERO + (Vector2.RIGHT * (i*10)), text[i])
|
||||
rotation += 10.0 if enable_rotation else 0
|
||||
draw_set_transform(Vector2.ZERO, deg_to_rad(rotation))
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://dcj3w8wie6ohv
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
extends Path2D
|
||||
|
||||
signal completed
|
||||
|
||||
var is_mouse_in_path_follow_area: bool = false
|
||||
var is_incantation_started: bool = false
|
||||
var incantation_progress: float = 0.0
|
||||
var is_incantation_completed: bool = false
|
||||
|
||||
@onready var area: Area2D = $Area2D
|
||||
@onready var incantation_text: IncantationText = $IncantationText
|
||||
|
||||
func _ready():
|
||||
area.mouse_entered.connect(func(): is_mouse_in_path_follow_area = true)
|
||||
area.mouse_exited.connect(func():
|
||||
is_mouse_in_path_follow_area = false
|
||||
reset_incantation()
|
||||
)
|
||||
|
||||
func _draw():
|
||||
# Draws debug line accross the path in game
|
||||
#var points = curve.get_baked_points()
|
||||
#for i in points.size():
|
||||
# if i == 0: continue
|
||||
# draw_line(points[i-1], points[i], Color.BLACK, 2.0)
|
||||
pass
|
||||
|
||||
var previous_offset: float:
|
||||
set(new_value):
|
||||
previous_offset = new_value
|
||||
incantation_text.colored_offset = previous_offset
|
||||
|
||||
func _input(event):
|
||||
if is_incantation_completed: return
|
||||
|
||||
if event is InputEventMouseButton:
|
||||
if event.is_pressed() and is_mouse_in_path_follow_area and not is_incantation_started:
|
||||
is_incantation_started = true
|
||||
if event is InputEventMouseMotion and is_incantation_started:
|
||||
var motion_event = event as InputEventMouseMotion
|
||||
var next_point = curve.get_closest_point(to_local(motion_event.global_position))
|
||||
var next_offset = curve.get_closest_offset(next_point)
|
||||
if previous_offset <= 0.0:
|
||||
previous_offset = next_offset
|
||||
elif next_offset - previous_offset <= 0:
|
||||
return
|
||||
previous_offset = next_offset
|
||||
area.position = next_point
|
||||
if next_point == curve.get_point_position(curve.point_count - 1):
|
||||
completed.emit()
|
||||
is_incantation_completed = true
|
||||
|
||||
func reset_incantation():
|
||||
if is_incantation_completed: return
|
||||
|
||||
is_incantation_started = false
|
||||
area.position = curve.get_point_position(0)
|
||||
previous_offset = 0.0
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://dak6uc4v3us7w
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
@tool
|
||||
class_name IncantationText
|
||||
extends Control
|
||||
|
||||
@export_multiline var text: String:
|
||||
set(new_value):
|
||||
text = new_value
|
||||
queue_redraw()
|
||||
@export var colored_offset: float = 0:
|
||||
set(new_value):
|
||||
colored_offset = new_value
|
||||
queue_redraw()
|
||||
|
||||
var curve: Curve2D
|
||||
|
||||
func _ready():
|
||||
curve = (get_parent() as Path2D).curve
|
||||
|
||||
func _draw():
|
||||
if text.length() < 2: return
|
||||
|
||||
var offset = 0
|
||||
for c in text:
|
||||
var t = curve.sample_baked_with_rotation(offset)
|
||||
draw_set_transform(t.origin - (Vector2.UP * 5).rotated(t.get_rotation()), t.get_rotation())
|
||||
draw_char(get_theme_default_font(), Vector2.ZERO, c, 16, Color.WHITE if offset >= colored_offset else Color.RED)
|
||||
offset += 10
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://cpscp5a5nxfop
|
||||
5
main.gd
5
main.gd
|
|
@ -2,7 +2,6 @@ extends Node2D
|
|||
|
||||
const DARK_CUT_SCENE = preload("res://operation/prototype_dark_cut.tscn")
|
||||
const DIALOG_SCENE = preload("res://dialog.tscn")
|
||||
const RITUAL_BOOK_SCENE = preload("res://prototype_ritual_book.tscn")
|
||||
|
||||
|
||||
@onready var room: Node2D = $Room
|
||||
|
|
@ -54,7 +53,3 @@ func _disable_node2d(node: Node2D):
|
|||
func _enable_node2d(node: Node2D):
|
||||
node.show()
|
||||
node.set_deferred("process", true)
|
||||
|
||||
|
||||
func _on_ritual_book_clicked():
|
||||
pass # Replace with function body.
|
||||
|
|
|
|||
42
main.tscn
42
main.tscn
|
|
@ -1,11 +1,9 @@
|
|||
[gd_scene load_steps=32 format=3 uid="uid://w3ntt1yh1nq7"]
|
||||
[gd_scene load_steps=28 format=3 uid="uid://w3ntt1yh1nq7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://lnmooufxbuym" path="res://main.gd" id="1_dp5o4"]
|
||||
[ext_resource type="PackedScene" uid="uid://3oqyqft8w72m" path="res://selectable.tscn" id="3_g5hfc"]
|
||||
[ext_resource type="Script" uid="uid://c3dlxuhruho8c" path="res://operation/feedback_canvas_modulate.gd" id="4_0odxb"]
|
||||
[ext_resource type="Texture2D" uid="uid://bicjfwpoa3pma" path="res://operation/test_table.png" id="5_lswn8"]
|
||||
[ext_resource type="Script" uid="uid://ctpgjvo5g0sav" path="res://ritual_book.gd" id="12_ycdy4"]
|
||||
[ext_resource type="PackedScene" uid="uid://qkwh186nbcya" path="res://prototype_ritual_book.tscn" id="13_ycdy4"]
|
||||
[ext_resource type="Texture2D" uid="uid://ccy71gl4qatjy" path="res://operation/pliers.png" id="17_b1qrp"]
|
||||
[ext_resource type="Script" uid="uid://crkr8emyhv1fo" path="res://operation/pliers.gd" id="18_come4"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3of67m4ic212" path="res://operation/pickup_area.tscn" id="19_h8e4i"]
|
||||
|
|
@ -51,8 +49,8 @@ width = 170
|
|||
height = 170
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_b76e3"]
|
||||
offsets = PackedFloat32Array(0.240678)
|
||||
colors = PackedColorArray(0.737193, 0.737193, 0.737193, 1)
|
||||
offsets = PackedFloat32Array(0.0881356)
|
||||
colors = PackedColorArray(0.0885599, 0.0885599, 0.0885599, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_soglf"]
|
||||
gradient = SubResource("Gradient_b76e3")
|
||||
|
|
@ -78,15 +76,6 @@ radius = 5.65684
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0odxb"]
|
||||
size = Vector2(110, 65)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_vivmo"]
|
||||
offsets = PackedFloat32Array(0.353357, 0.929329, 1)
|
||||
colors = PackedColorArray(0, 0, 0, 1, 0.498233, 0.498233, 0.498233, 1, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_2cqfq"]
|
||||
gradient = SubResource("Gradient_vivmo")
|
||||
width = 32
|
||||
height = 128
|
||||
|
||||
[node name="Main" type="Node2D"]
|
||||
script = ExtResource("1_dp5o4")
|
||||
|
||||
|
|
@ -142,6 +131,8 @@ position = Vector2(242, 258)
|
|||
texture = SubResource("GradientTexture2D_ty4ro")
|
||||
|
||||
[node name="Selectable" parent="Room/Bob" instance=ExtResource("3_g5hfc")]
|
||||
collision_layer = 256
|
||||
collision_mask = 256
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Room/Bob/Selectable"]
|
||||
polygon = PackedVector2Array(-50, 100, -50, -100, 50, -100, 50, 100)
|
||||
|
|
@ -258,31 +249,8 @@ collision_mask = 8
|
|||
scale = Vector2(0.983051, 1)
|
||||
shape = SubResource("RectangleShape2D_0odxb")
|
||||
|
||||
[node name="RitualBook" type="Node2D" parent="Shelves"]
|
||||
position = Vector2(-92, 240.5)
|
||||
script = ExtResource("12_ycdy4")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Shelves/RitualBook"]
|
||||
texture = SubResource("GradientTexture2D_2cqfq")
|
||||
|
||||
[node name="Selectable" parent="Shelves/RitualBook/Sprite2D" instance=ExtResource("3_g5hfc")]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Shelves/RitualBook/Sprite2D/Selectable"]
|
||||
polygon = PackedVector2Array(-16, -64, -16, 64, 16, 64, 16, -64)
|
||||
|
||||
[node name="Label" type="Label" parent="Shelves/RitualBook"]
|
||||
offset_left = -17.0
|
||||
offset_top = 40.5
|
||||
offset_right = 68.0
|
||||
offset_bottom = 63.5
|
||||
rotation = -1.5708
|
||||
text = "Rituals 101"
|
||||
|
||||
[node name="PrototypeRitualBook" parent="." instance=ExtResource("13_ycdy4")]
|
||||
|
||||
[connection signal="clicked" from="Room/Bob/Selectable" to="." method="_on_bob_clicked"]
|
||||
[connection signal="clicked" from="Room/RitualPlace/Selectable" to="." method="_on_ritual_place_clicked"]
|
||||
[connection signal="area_entered" from="Shelves/Scalpel/CutArea" to="Shelves/Scalpel" method="_on_cut_area_area_entered"]
|
||||
[connection signal="area_exited" from="Shelves/Scalpel/CutArea" to="Shelves/Scalpel" method="_on_cut_area_area_exited"]
|
||||
[connection signal="timeout" from="Shelves/Scalpel/CutHurtTimer" to="Shelves/Scalpel" method="_on_cut_hurt_timer_timeout"]
|
||||
[connection signal="clicked" from="Shelves/RitualBook/Sprite2D/Selectable" to="." method="_on_ritual_book_clicked"]
|
||||
|
|
|
|||
26
map_point.gd
26
map_point.gd
|
|
@ -1,26 +0,0 @@
|
|||
@tool
|
||||
class_name MapPoint
|
||||
extends Node2D
|
||||
|
||||
|
||||
@export_tool_button("Update lines", "Callable") var update_lines = queue_redraw
|
||||
@export var connected_map_points: Array[MapPoint] = []:
|
||||
set(new_value):
|
||||
connected_map_points = new_value
|
||||
queue_redraw()
|
||||
|
||||
@onready var hover_dot: Sprite2D = $HoverDot
|
||||
|
||||
|
||||
func _ready():
|
||||
queue_redraw()
|
||||
|
||||
func _on_area_2d_mouse_entered():
|
||||
hover_dot.show()
|
||||
|
||||
func _on_area_2d_mouse_exited():
|
||||
hover_dot.hide()
|
||||
|
||||
func _draw():
|
||||
for p in connected_map_points:
|
||||
draw_dashed_line(Vector2.ZERO, to_local(p.global_position), Color.BLACK)
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://bhct6bhjtnml0
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://b5tdh43sbe5nj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bhct6bhjtnml0" path="res://map_point.gd" id="1_jfx02"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_tn1m0"]
|
||||
offsets = PackedFloat32Array(0.40636, 0.45583)
|
||||
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_pw3im"]
|
||||
gradient = SubResource("Gradient_tn1m0")
|
||||
width = 40
|
||||
height = 40
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_ywy6p"]
|
||||
offsets = PackedFloat32Array(0.40636, 0.45583)
|
||||
colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 0)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_gpntq"]
|
||||
gradient = SubResource("Gradient_ywy6p")
|
||||
width = 32
|
||||
height = 32
|
||||
fill = 1
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_01fxh"]
|
||||
radius = 13.0384
|
||||
|
||||
[node name="MapPoint" type="Node2D"]
|
||||
script = ExtResource("1_jfx02")
|
||||
|
||||
[node name="HoverDot" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
texture = SubResource("GradientTexture2D_pw3im")
|
||||
|
||||
[node name="Dot" type="Sprite2D" parent="."]
|
||||
texture = SubResource("GradientTexture2D_gpntq")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 1024
|
||||
collision_mask = 1024
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("CircleShape2D_01fxh")
|
||||
|
||||
[connection signal="mouse_entered" from="Area2D" to="." method="_on_area_2d_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="Area2D" to="." method="_on_area_2d_mouse_exited"]
|
||||
|
|
@ -27,10 +27,6 @@ cutter=""
|
|||
grabber=""
|
||||
patience_bar=""
|
||||
|
||||
[gui]
|
||||
|
||||
theme/default_font_multichannel_signed_distance_field=true
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_physics/layer_1="Scalpel"
|
||||
|
|
@ -38,8 +34,6 @@ theme/default_font_multichannel_signed_distance_field=true
|
|||
2d_physics/layer_3="Body"
|
||||
2d_physics/layer_4="Pliers"
|
||||
2d_physics/layer_9="Selectable"
|
||||
2d_physics/layer_10="Incantation"
|
||||
2d_physics/layer_11="Map"
|
||||
|
||||
[rendering]
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
extends Node2D
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://cvcec0uf3erkv
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://cb4cokd0lxacj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvcec0uf3erkv" path="res://prototype_map.gd" id="1_mj08v"]
|
||||
[ext_resource type="PackedScene" uid="uid://b5tdh43sbe5nj" path="res://map_point.tscn" id="2_mj08v"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_6vn6g"]
|
||||
offsets = PackedFloat32Array(0.575972, 0.929329, 1)
|
||||
colors = PackedColorArray(0.74902, 0.647059, 0.541176, 1, 0.61, 0.527447, 0.4392, 1, 0.19, 0.164287, 0.1368, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_fjiih"]
|
||||
gradient = SubResource("Gradient_6vn6g")
|
||||
width = 850
|
||||
height = 500
|
||||
fill = 2
|
||||
fill_from = Vector2(0.5, 0.5)
|
||||
|
||||
[node name="PrototypeMap" type="Node2D"]
|
||||
script = ExtResource("1_mj08v")
|
||||
|
||||
[node name="Background" type="Sprite2D" parent="."]
|
||||
position = Vector2(497, 315)
|
||||
texture = SubResource("GradientTexture2D_fjiih")
|
||||
|
||||
[node name="MapPoint" parent="." node_paths=PackedStringArray("connected_map_points") instance=ExtResource("2_mj08v")]
|
||||
position = Vector2(199, 332)
|
||||
connected_map_points = [NodePath("../MapPoint2")]
|
||||
|
||||
[node name="MapPoint2" parent="." node_paths=PackedStringArray("connected_map_points") instance=ExtResource("2_mj08v")]
|
||||
position = Vector2(256, 299)
|
||||
connected_map_points = [NodePath("../MapPoint3"), NodePath("../MapPoint4")]
|
||||
|
||||
[node name="MapPoint3" parent="." instance=ExtResource("2_mj08v")]
|
||||
position = Vector2(315, 278)
|
||||
|
||||
[node name="MapPoint4" parent="." instance=ExtResource("2_mj08v")]
|
||||
position = Vector2(320, 330)
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
extends Node2D
|
||||
|
||||
signal incantation_completed
|
||||
|
||||
func _on_incantation_completed():
|
||||
incantation_completed.emit()
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://dsiaa53vt3y6e
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://qkwh186nbcya"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dak6uc4v3us7w" path="res://incantation.gd" id="1_v6csu"]
|
||||
[ext_resource type="Script" uid="uid://dsiaa53vt3y6e" path="res://prototype_ritual_book.gd" id="1_yc2mw"]
|
||||
[ext_resource type="Script" uid="uid://cpscp5a5nxfop" path="res://incantation_text.gd" id="2_5ntyk"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_2cqfq"]
|
||||
offsets = PackedFloat32Array(0.80212, 0.978799, 1)
|
||||
colors = PackedColorArray(0.74902, 0.647059, 0.541176, 1, 0.43, 0.371807, 0.3096, 1, 0.19, 0.164287, 0.1368, 1)
|
||||
|
||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_yaehf"]
|
||||
gradient = SubResource("Gradient_2cqfq")
|
||||
width = 300
|
||||
height = 400
|
||||
|
||||
[sub_resource type="Curve2D" id="Curve2D_5ntyk"]
|
||||
_data = {
|
||||
"points": PackedVector2Array(0, 0, 0, 0, 202, 149, -40.482, 1.54217, 40.482, -1.54217, 248, 178, -17.3494, 5.01206, 17.3494, -5.01206, 309, 150, -10.7952, -15.0362, 10.7952, 15.0362, 380, 180, 0, 0, 0, 0, 380, 180, 32.7712, -32.7712, -32.7712, 32.7712, 379, 257, 30.385, 3.70613, -30.385, -3.70613, 305, 219, 0, 0, -49.7351, 23.1326, 255, 252, 27.3736, -12.3374, -27.3736, 12.3374, 198, 230, -28.5302, -24.6748, 28.5302, 24.6748, 202, 319, 0, 0, 0, 0, 377, 318)
|
||||
}
|
||||
point_count = 11
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_v6csu"]
|
||||
radius = 13.8924
|
||||
|
||||
[node name="PrototypeRitualBook" type="Node2D"]
|
||||
script = ExtResource("1_yc2mw")
|
||||
|
||||
[node name="Left" type="Sprite2D" parent="."]
|
||||
position = Vector2(306, 311)
|
||||
texture = SubResource("GradientTexture2D_yaehf")
|
||||
|
||||
[node name="Right" type="Sprite2D" parent="."]
|
||||
position = Vector2(606, 311)
|
||||
rotation = 3.14159
|
||||
texture = SubResource("GradientTexture2D_yaehf")
|
||||
|
||||
[node name="Incantation" type="Path2D" parent="."]
|
||||
position = Vector2(-1, 1)
|
||||
curve = SubResource("Curve2D_5ntyk")
|
||||
script = ExtResource("1_v6csu")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="Incantation"]
|
||||
position = Vector2(202, 149)
|
||||
rotation = 0.562498
|
||||
collision_layer = 512
|
||||
collision_mask = 512
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Incantation/Area2D"]
|
||||
shape = SubResource("CircleShape2D_v6csu")
|
||||
|
||||
[node name="IncantationText" type="Control" parent="Incantation"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
script = ExtResource("2_5ntyk")
|
||||
text = "Hallo dies ist ein langer TExt, er könnte auch eine Ritual sein. Wir werden sehen"
|
||||
|
||||
[connection signal="completed" from="Incantation" to="." method="_on_incantation_completed"]
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
class_name RitualBook
|
||||
extends Node2D
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://ctpgjvo5g0sav
|
||||
|
|
@ -23,7 +23,7 @@ func _ready():
|
|||
|
||||
func _input(event):
|
||||
if is_clickable and event is InputEventMouseButton and event.is_pressed():
|
||||
clicked.emit()
|
||||
clicked.emit()
|
||||
|
||||
func _on_mouse_entered():
|
||||
is_clickable = true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue