This commit is contained in:
user 2025-01-11 14:03:40 +01:00
parent 74502c52dd
commit fd889ef231
35 changed files with 592 additions and 712 deletions

View File

@ -11,18 +11,18 @@ class_name DisposableBase
var this
func _init():
this = self
this.unreference()
this = self
this.unreference()
## Disposes the disposable and executes a defined action.
func dispose():
NotImplementedError.raise()
NotImplementedError.raise()
## Links disposable to [Object] lifetime via an [AutoDisposer]
func dispose_with(_obj : Object) -> DisposableBase:
NotImplementedError.raise()
return null
NotImplementedError.raise()
return null
func _notification(what):
if what == NOTIFICATION_PREDELETE:
this.dispose()
if what == NOTIFICATION_PREDELETE:
this.dispose()

View File

@ -5,39 +5,39 @@ class_name AutoDisposer
var _disp : DisposableBase
func _init(disp : DisposableBase):
self._disp = disp
self._disp = disp
func _notification(what):
if what == NOTIFICATION_PREDELETE:
self._disp.dispose()
if what == NOTIFICATION_PREDELETE:
self._disp.dispose()
static func _meta_key(obj : Object, disp : DisposableBase):
var disp_id : int = disp.get_instance_id()
var obj_id : int = obj.get_instance_id()
var meta_entry = "autodispose_" + \
("0" if disp_id > 0 else "1") + \
("0" if obj_id > 0 else "1") + \
"_d" + str(abs(disp_id)) + "_o" + str(abs(obj_id))
return meta_entry
var disp_id : int = disp.get_instance_id()
var obj_id : int = obj.get_instance_id()
var meta_entry = "autodispose_" + \
("0" if disp_id > 0 else "1") + \
("0" if obj_id > 0 else "1") + \
"_d" + str(abs(disp_id)) + "_o" + str(abs(obj_id))
return meta_entry
static func _collect_garbage(obj : Object):
for meta_key in obj.get_meta_list():
var meta_entry = obj.get_meta(meta_key)
if meta_entry is AutoDisposer:
if meta_entry._disp.get("is_disposed"):
obj.remove_meta(meta_entry)
for meta_key in obj.get_meta_list():
var meta_entry = obj.get_meta(meta_key)
if meta_entry is AutoDisposer:
if meta_entry._disp.get("is_disposed"):
obj.remove_meta(meta_entry)
static func add(obj : Object, disp : DisposableBase) -> AutoDisposer:
AutoDisposer._collect_garbage(obj)
var auto_disposer : AutoDisposer = AutoDisposer.new(disp)
var meta_key = AutoDisposer._meta_key(obj, disp)
obj.set_meta(meta_key, auto_disposer)
return auto_disposer
AutoDisposer._collect_garbage(obj)
var auto_disposer : AutoDisposer = AutoDisposer.new(disp)
var meta_key = AutoDisposer._meta_key(obj, disp)
obj.set_meta(meta_key, auto_disposer)
return auto_disposer
static func remove(obj : Object, disp : DisposableBase):
var meta_key = AutoDisposer._meta_key(obj, disp)
obj.remove_meta(meta_key)
var meta_key = AutoDisposer._meta_key(obj, disp)
obj.remove_meta(meta_key)
static func remove_and_dispose(obj : Object, disp : DisposableBase):
AutoDisposer.remove(obj, disp)
disp.dispose()
AutoDisposer.remove(obj, disp)
disp.dispose()

View File

@ -1,29 +1,29 @@
class _NodeLifecycleListener extends Node:
signal on_event(data)
signal on_event(data)
class _ListenerOnProcess extends _NodeLifecycleListener:
func _process(delta : float):
on_event.emit(delta)
func _process(delta : float):
on_event.emit(delta)
class _ListenerOnPhysicsProcess extends _NodeLifecycleListener:
func _physics_process(delta : float):
on_event.emit(delta)
func _physics_process(delta : float):
on_event.emit(delta)
class _ListenerOnInput extends _NodeLifecycleListener:
func _input(event : InputEvent):
on_event.emit(event)
func _input(event : InputEvent):
on_event.emit(event)
class _ListenerOnShortcutInput extends _NodeLifecycleListener:
func _shortcut_input(event : InputEvent):
on_event.emit(event)
func _shortcut_input(event : InputEvent):
on_event.emit(event)
class _ListenerOnUnhandledInput extends _NodeLifecycleListener:
func _unhandled_input(event : InputEvent):
on_event.emit(event)
func _unhandled_input(event : InputEvent):
on_event.emit(event)
class _ListenerOnUnhandledKeyInput extends _NodeLifecycleListener:
func _unhandled_key_input(event : InputEvent):
on_event.emit(event)
func _unhandled_key_input(event : InputEvent):
on_event.emit(event)
## Represents [Node] lifecycle events like [method Node._process].
## Observable emits argument from call as item on the stream.
@ -31,45 +31,45 @@ class _ListenerOnUnhandledKeyInput extends _NodeLifecycleListener:
## [color=yellow]Warning![/color] This only creates a Node of type [b]_NodeLifecycleListener[/b]
## which is added as a child since it is not possible to get signals on lifecycle callbacks.
static func from_godot_node_lifecycle_event_(conn : Node, type : int) -> Observable:
var listener : RefValue = RefValue.Null()
var count : RefValue = RefValue.Set(0)
var listener : RefValue = RefValue.Null()
var count : RefValue = RefValue.Set(0)
var subscribe = func(
observer : ObserverBase,
scheduler : SchedulerBase = null
) -> DisposableBase:
if count.v == 0:
match type:
0:
listener.v = _ListenerOnProcess.new()
1:
listener.v = _ListenerOnPhysicsProcess.new()
2:
listener.v = _ListenerOnInput.new()
3:
listener.v = _ListenerOnShortcutInput.new()
4:
listener.v = _ListenerOnUnhandledInput.new()
5:
listener.v = _ListenerOnUnhandledKeyInput.new()
listener.v.name = "__Listener$" + str(conn.get_instance_id()) + "__"
listener.v.process_priority = conn.process_priority
listener.v.process_mode = conn.process_mode
listener.v.process_physics_priority = conn.process_physics_priority
conn.call_deferred("add_child", listener.v)
count.v += 1
var subscribe = func(
observer : ObserverBase,
scheduler : SchedulerBase = null
) -> DisposableBase:
if count.v == 0:
match type:
0:
listener.v = _ListenerOnProcess.new()
1:
listener.v = _ListenerOnPhysicsProcess.new()
2:
listener.v = _ListenerOnInput.new()
3:
listener.v = _ListenerOnShortcutInput.new()
4:
listener.v = _ListenerOnUnhandledInput.new()
5:
listener.v = _ListenerOnUnhandledKeyInput.new()
listener.v.name = "__Listener$" + str(conn.get_instance_id()) + "__"
listener.v.process_priority = conn.process_priority
listener.v.process_mode = conn.process_mode
listener.v.process_physics_priority = conn.process_physics_priority
conn.call_deferred("add_child", listener.v)
count.v += 1
var dispose = func():
count.v -= 1
if count.v == 0 and listener.v != null:
listener.v.queue_free()
var dispose = func():
count.v -= 1
if count.v == 0 and listener.v != null:
listener.v.queue_free()
var subscription = GDRx.gd.from_godot_signal(listener.v.on_event).subscribe(
observer, GDRx.basic.noop, GDRx.basic.noop,
scheduler
)
var subscription = GDRx.gd.from_godot_signal(listener.v.on_event).subscribe(
observer, GDRx.basic.noop, GDRx.basic.noop,
scheduler
)
var cd : CompositeDisposable = CompositeDisposable.new([subscription, Disposable.new(dispose)])
return cd
var cd : CompositeDisposable = CompositeDisposable.new([subscription, Disposable.new(dispose)])
return cd
return Observable.new(subscribe)
return Observable.new(subscribe)

View File

@ -5,11 +5,11 @@ const UTC_ZERO : float = Scheduler.UTC_ZERO
const DELTA_ZERO : float = Scheduler.DELTA_ZERO
func _init(verify_ = null):
if not verify_ == "GDRx":
push_warning("Warning! Must only instance Scheduler from GDRx singleton!")
if not verify_ == "GDRx":
push_warning("Warning! Must only instance Scheduler from GDRx singleton!")
static func singleton() -> GodotSignalScheduler:
return GDRx.GodotSignalScheduler_
return GDRx.GodotSignalScheduler_
## Represents a notion of time for this scheduler. Tasks being
## scheduled on a scheduler will adhere to the time denoted by this
@ -19,7 +19,7 @@ static func singleton() -> GodotSignalScheduler:
## [br]
## The scheduler's current time, as a datetime instance.
func now() -> float:
return GDRx.basic.default_now()
return GDRx.basic.default_now()
## Invoke the given given action. This is typically called by instances
## of [ScheduledItem].
@ -35,10 +35,10 @@ func now() -> float:
## The disposable object returned by the action, if any; or a new
## (no-op) disposable otherwise.
func invoke_action(action : Callable, state = null) -> DisposableBase:
var ret = action.call(self, state)
if ret is DisposableBase:
return ret
return Disposable.new()
var ret = action.call(self, state)
if ret is DisposableBase:
return ret
return Disposable.new()
## Schedules an action to be executed when the [Signal] is emitted.
## [br]
@ -59,76 +59,76 @@ func invoke_action(action : Callable, state = null) -> DisposableBase:
## [br]
## The disposable object used to cancel the scheduled action.
func schedule_signal(
sig : Signal,
n_args : int,
action : Callable,
state = null
sig : Signal,
n_args : int,
action : Callable,
state = null
) -> DisposableBase:
var disp : Disposable = Disposable.new()
var disp : Disposable = Disposable.new()
var signal_callback : Callable
match n_args:
0:
signal_callback = func():
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call()
disp = self.invoke_action(action_, state)
1:
signal_callback = func(arg1):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1)
disp = self.invoke_action(action_, state)
2:
signal_callback = func(arg1, arg2):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2)
disp = self.invoke_action(action_, state)
3:
signal_callback = func(arg1, arg2, arg3):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3)
disp = self.invoke_action(action_, state)
4:
signal_callback = func(arg1, arg2, arg3, arg4):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4)
disp = self.invoke_action(action_, state)
5:
signal_callback = func(arg1, arg2, arg3, arg4, arg5):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5)
disp = self.invoke_action(action_, state)
6:
signal_callback = func(arg1, arg2, arg3, arg4, arg5, arg6):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5, arg6)
disp = self.invoke_action(action_, state)
7:
signal_callback = func(arg1, arg2, arg3, arg4, arg5, arg6, arg7):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
disp = self.invoke_action(action_, state)
8:
signal_callback = func(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
disp = self.invoke_action(action_, state)
_:
GDRx.raise(TooManyArgumentsError.new(
"Only up to 8 signal parameters supported! Use lists instead!"))
return null
var signal_callback : Callable
match n_args:
0:
signal_callback = func():
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call()
disp = self.invoke_action(action_, state)
1:
signal_callback = func(arg1):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1)
disp = self.invoke_action(action_, state)
2:
signal_callback = func(arg1, arg2):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2)
disp = self.invoke_action(action_, state)
3:
signal_callback = func(arg1, arg2, arg3):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3)
disp = self.invoke_action(action_, state)
4:
signal_callback = func(arg1, arg2, arg3, arg4):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4)
disp = self.invoke_action(action_, state)
5:
signal_callback = func(arg1, arg2, arg3, arg4, arg5):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5)
disp = self.invoke_action(action_, state)
6:
signal_callback = func(arg1, arg2, arg3, arg4, arg5, arg6):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5, arg6)
disp = self.invoke_action(action_, state)
7:
signal_callback = func(arg1, arg2, arg3, arg4, arg5, arg6, arg7):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
disp = self.invoke_action(action_, state)
8:
signal_callback = func(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8):
var action_ = func(_scheduler : SchedulerBase, _state = null):
action.call(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
disp = self.invoke_action(action_, state)
_:
GDRx.raise(TooManyArgumentsError.new(
"Only up to 8 signal parameters supported! Use lists instead!"))
return null
var obj = instance_from_id(sig.get_object_id())
var obj = instance_from_id(sig.get_object_id())
var dispose = func():
if obj != null:
sig.disconnect(signal_callback)
var dispose = func():
if obj != null:
sig.disconnect(signal_callback)
sig.connect(signal_callback)
sig.connect(signal_callback)
var cd : CompositeDisposable = CompositeDisposable.new([disp, Disposable.new(dispose)])
return cd
var cd : CompositeDisposable = CompositeDisposable.new([disp, Disposable.new(dispose)])
return cd
## Schedules an action to be executed.
## [br]
@ -143,18 +143,18 @@ func schedule_signal(
## The disposable object used to cancel the scheduled action
## (best effort).
func schedule(action : Callable, state = null) -> DisposableBase:
var sad : SingleAssignmentDisposable = SingleAssignmentDisposable.new()
var sad : SingleAssignmentDisposable = SingleAssignmentDisposable.new()
var interval = func():
sad.disposable = self.invoke_action(action, state)
var interval = func():
sad.disposable = self.invoke_action(action, state)
var timer : SceneTreeTimer = GDRx.get_tree().create_timer(0.0)
timer.connect("timeout", func(): interval.call() ; _cancel_timer(timer))
var timer : SceneTreeTimer = GDRx.get_tree().create_timer(0.0)
timer.connect("timeout", func(): interval.call() ; _cancel_timer(timer))
var dispose = func():
_cancel_timer(timer)
var dispose = func():
_cancel_timer(timer)
return CompositeDisposable.new([sad, Disposable.new(dispose)])
return CompositeDisposable.new([sad, Disposable.new(dispose)])
## Schedules an action to be executed after duetime.
## [br]
@ -172,22 +172,22 @@ func schedule(action : Callable, state = null) -> DisposableBase:
## The disposable object used to cancel the scheduled action
## (best effort).
func schedule_relative(duetime, action : Callable, state = null) -> DisposableBase:
var seconds : float = duetime
if seconds <= 0.0:
return self.schedule(action, state)
var seconds : float = duetime
if seconds <= 0.0:
return self.schedule(action, state)
var sad : SingleAssignmentDisposable = SingleAssignmentDisposable.new()
var sad : SingleAssignmentDisposable = SingleAssignmentDisposable.new()
var interval = func():
sad.disposable = self.invoke_action(action, state)
var interval = func():
sad.disposable = self.invoke_action(action, state)
var timer = GDRx.get_tree().create_timer(seconds)
timer.connect("timeout", func(): interval.call() ; _cancel_timer(timer))
var timer = GDRx.get_tree().create_timer(seconds)
timer.connect("timeout", func(): interval.call() ; _cancel_timer(timer))
var dispose = func():
_cancel_timer(timer)
var dispose = func():
_cancel_timer(timer)
return CompositeDisposable.new([sad, Disposable.new(dispose)])
return CompositeDisposable.new([sad, Disposable.new(dispose)])
## Schedules an action to be executed at duetime.
## [br]
@ -205,9 +205,9 @@ func schedule_relative(duetime, action : Callable, state = null) -> DisposableBa
## The disposable object used to cancel the scheduled action
## (best effort).
func schedule_absolute(duetime, action : Callable, state = null) -> DisposableBase:
return self.schedule_relative(duetime - self.now(), action, state)
return self.schedule_relative(duetime - self.now(), action, state)
## Utility function to cancel a timer
func _cancel_timer(timer : SceneTreeTimer):
for conn in timer.timeout.get_connections():
timer.timeout.disconnect(conn["callable"])
for conn in timer.timeout.get_connections():
timer.timeout.disconnect(conn["callable"])

View File

@ -1,5 +1,5 @@
static func filter_(predicate : Callable = GDRx.basic.default_condition) -> Callable:
var filter = func(source : Observable) -> Observable:
var filter = func(source : Observable) -> Observable:
# """Partially applied filter operator.
#
# Filters the elements of an observable sequence based on a
@ -14,34 +14,34 @@ static func filter_(predicate : Callable = GDRx.basic.default_condition) -> Call
# Returns:
# A filtered observable sequence.
# """
var subscribe = func(
observer : ObserverBase,
scheduler : SchedulerBase = null
) -> DisposableBase:
var on_next = func(value):
var should_run = RefValue.Set(true)
if GDRx.try(func():
should_run.v = predicate.call(value)
) \
.catch("Error", func(err):
observer.on_error(err)
) \
.end_try_catch(): return
var subscribe = func(
observer : ObserverBase,
scheduler : SchedulerBase = null
) -> DisposableBase:
var on_next = func(value):
var should_run = RefValue.Set(true)
if GDRx.try(func():
should_run.v = predicate.call(value)
) \
.catch("Error", func(err):
observer.on_error(err)
) \
.end_try_catch(): return
if should_run.v:
observer.on_next(value)
if should_run.v:
observer.on_next(value)
return source.subscribe(
on_next, observer.on_error, observer.on_completed,
scheduler
)
return source.subscribe(
on_next, observer.on_error, observer.on_completed,
scheduler
)
return Observable.new(subscribe)
return Observable.new(subscribe)
return filter
return filter
static func filter_indexed_(predicate : Callable = GDRx.basic.default_condition) -> Callable:
var filter_indexed = func(source : Observable) -> Observable:
var filter_indexed = func(source : Observable) -> Observable:
# """Partially applied indexed filter operator.
#
# Filters the elements of an observable sequence based on a
@ -56,27 +56,27 @@ static func filter_indexed_(predicate : Callable = GDRx.basic.default_condition)
# Returns:
# A filtered observable sequence.
# """
var subscribe = func(
observer : ObserverBase,
scheduler : SchedulerBase = null
) -> DisposableBase:
var subscribe = func(
observer : ObserverBase,
scheduler : SchedulerBase = null
) -> DisposableBase:
var count = RefValue.Set(0)
var count = RefValue.Set(0)
var on_next = func(value):
var should_run = predicate.call(value, count.v)
if not should_run is bool:
observer.on_error(BadArgumentError.new())
return
count.v += 1
if should_run:
observer.on_next(value)
var on_next = func(value):
var should_run = predicate.call(value, count.v)
if not should_run is bool:
observer.on_error(BadArgumentError.new())
return
count.v += 1
if should_run:
observer.on_next(value)
return source.subscribe(
on_next, observer.on_error, observer.on_completed,
scheduler
)
return source.subscribe(
on_next, observer.on_error, observer.on_completed,
scheduler
)
return Observable.new(subscribe)
return Observable.new(subscribe)
return filter_indexed
return filter_indexed

View File

@ -1,14 +0,0 @@
extends ColorRect
@export var choice: Globals.SkinChoices = Globals.SkinChoices.HEAD
func _on_mouse_entered() -> void:
Input.set_custom_mouse_cursor(load("res://assets/spine/out/cursor.png"))
func _on_mouse_exited() -> void:
Input.set_custom_mouse_cursor(null)
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.pressed:
var ec: EvilCoco = Globals.evil_coco
$"../AudioStreamPlayer2D2".play()
ec.set_skin(self.choice)

11
assets/scenes/deleteme.gd Normal file
View File

@ -0,0 +1,11 @@
extends Area2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@ -1,102 +0,0 @@
[gd_scene load_steps=15 format=3 uid="uid://c837kn1e7luak"]
[ext_resource type="Script" path="res://assets/scenes/main.gd" id="1_pnxqy"]
[ext_resource type="Shader" path="res://assets/scenes/bg.gdshader" id="1_ymxgg"]
[ext_resource type="Texture2D" uid="uid://c6r3b4befr4mp" path="res://assets/bitmaps/bubbles.png" id="2_6jf1e"]
[ext_resource type="SpineAtlasResource" uid="uid://dxoeuw18xmsqy" path="res://assets/spine/evilcoco.atlas" id="3_3nlx6"]
[ext_resource type="SpineSkeletonFileResource" uid="uid://xmd724lyi37d" path="res://assets/spine/evilcoco.skel" id="4_ajbkn"]
[ext_resource type="Script" path="res://assets/scenes/spine_sprite.gd" id="5_ehebj"]
[ext_resource type="SpineAtlasResource" uid="uid://co5qu15dmcr67" path="res://assets/spine/nv_hand.atlas" id="6_xg0ck"]
[ext_resource type="SpineSkeletonFileResource" uid="uid://bjk0p3k2o0f77" path="res://assets/spine/nv_hand.skel" id="7_ml6hw"]
[ext_resource type="Script" path="res://assets/scenes/nv_hand.gd" id="8_8w1py"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8mp0w"]
shader = ExtResource("1_ymxgg")
shader_parameter/bottom_color = Color(0.879308, 0.597089, 3.85046e-07, 1)
shader_parameter/top_color = Color(0.960341, 0.442215, 0, 1)
shader_parameter/layer_count = 11
shader_parameter/time_scale = 0.2
shader_parameter/base_intensity = 0.5
shader_parameter/size = 1.0
shader_parameter/tex = ExtResource("2_6jf1e")
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_pkoje"]
atlas_res = ExtResource("3_3nlx6")
skeleton_file_res = ExtResource("4_ajbkn")
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_bi8ad"]
atlas_res = ExtResource("6_xg0ck")
skeleton_file_res = ExtResource("7_ml6hw")
[sub_resource type="Environment" id="Environment_71opc"]
background_mode = 1
background_color = Color(0.842604, 0.404486, 0.626903, 1)
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_pdmnu"]
[node name="Main" type="Node"]
script = ExtResource("1_pnxqy")
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="ColorRect" type="ColorRect" parent="Control"]
material = SubResource("ShaderMaterial_8mp0w")
layout_mode = 0
offset_left = -570.0
offset_top = -976.0
offset_right = 542.0
offset_bottom = 971.0
pivot_offset = Vector2(-38, 1462)
color = Color(1, 0.34902, 1, 1)
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="Control"]
layout_mode = 2
offset_right = 700.0
offset_bottom = 615.0
[node name="EvilCoco1" type="SpineSprite" parent="Control/AspectRatioContainer"]
position = Vector2(-929, -911)
scale = Vector2(1.13171, 1.13171)
skeleton_data_res = SubResource("SpineSkeletonDataResource_pkoje")
preview_skin = "Default"
preview_animation = "-- Empty --"
preview_frame = false
preview_time = 0.0
script = ExtResource("5_ehebj")
[node name="CrosshairBone" type="SpineBoneNode" parent="Control/AspectRatioContainer/EvilCoco1"]
show_behind_parent = true
position = Vector2(368.469, -370.236)
rotation = -1.40981
bone_name = "crosshair"
bone_mode = 1
[node name="NVHand" type="SpineSprite" parent="Control/AspectRatioContainer"]
visible = false
position = Vector2(-1852.43, -1694.76)
scale = Vector2(1.60198, 1.60198)
skeleton_data_res = SubResource("SpineSkeletonDataResource_bi8ad")
preview_skin = "Default"
preview_animation = "-- Empty --"
preview_frame = false
preview_time = 0.0
script = ExtResource("8_8w1py")
[node name="ColorRect" type="ColorRect" parent="Control/AspectRatioContainer"]
layout_mode = 2
size_flags_horizontal = 8
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_71opc")
camera_attributes = SubResource("CameraAttributesPractical_pdmnu")
[node name="Camera2D" type="Camera2D" parent="."]
[node name="fire_sfx" type="AudioStreamPlayer2D" parent="."]
position = Vector2(-954, 161)
volume_db = 10.0
autoplay = true

View File

@ -1,7 +1,154 @@
extends Node
func _ready() -> void:
pass # Replace with function body.
enum scene {
INTRO,
MAIN,
}
func _process(delta: float) -> void:
pass
@onready var crosshair_bone: SpineBoneNode = %CrosshairBone
@onready var evil_coco1: SpineSprite = %EvilCoco1
@onready var evil_coco2: SpineSprite = %EvilCoco2
@onready var ui: SpineSprite = %UI
@onready var ui_bone: SpineBoneNode = %UIBone
@onready var nv_hand: SpineSprite = %NVHand
@onready var gear_collision: CollisionPolygon2D = %GearCollision
@onready var gear_area: Area2D = %GearArea
var bounceS = GDRx.on_input_as_observable(self)\
.filter(is_right_mouse_click)\
.subscribe(start)\
.dispose_with(self)
func _ready() -> void:
#GDRx.from_signal(gear_enter_area.area_entered)
print(gear_area.collision_layer)
var gearOnS = GDRx.from_signal(gear_area.mouse_shape_entered)\
#.filter(is_right_mouse_click)\
.subscribe(show_ui)\
.dispose_with(self)
var gearOffS = GDRx.from_signal(gear_area.mouse_shape_exited)\
#.filter(is_right_mouse_click)\
.subscribe(hide_ui)\
.dispose_with(self)
var crosshairS = GDRx.on_process_as_observable(self)\
#.debounce(1)\
.subscribe(crosshair)\
.dispose_with(self)
var uiBoneS = GDRx.on_process_as_observable(self)\
#.debounce(1)\
.subscribe(ui_crosshair)\
.dispose_with(self)
#var play_soundsS = GDRx.from_signal(ui.animation_event)\
#.subscribe(func(a): print("play sound"); print(a))\
#.dispose_with(ui)
#var play_idleS = GDRx.from_signal(evil_coco2.animation_event)\
#.subscribe(func(a): print("idle"))\
#.dispose_with(ui)
evil_coco1.show()
evil_coco2.hide()
nv_hand.hide()
ui.hide()
evil_coco1.get_animation_state().set_animation("idle", true)
func ui_crosshair(_delta):
gear_area.global_position = ui_bone.global_position
func test_func(a: Object):
print(a.sprite)
var thisScript = a.get_script()
print('Properties of "%s":' % [ thisScript.resource_path ])
for propertyInfo in thisScript.get_script_property_list():
var propertyName: String = propertyInfo.name
var propertyValue = get(propertyName)
print(' %s = %s' % [ propertyName, propertyValue ])
func start(event: InputEvent) -> void:
evil_coco1.hide()
evil_coco2.show()
evil_coco2.get_animation_state().set_animation("start", false)
ui.show()
bounceS.dispose()
ui.get_animation_state().set_animation("main/closing", false)
evil_coco2.animation_event.connect(bounce)
ui.animation_event.connect(play_sounds)
func bounce(sprite: SpineSprite, animation_state: SpineAnimationState, track_entry: SpineTrackEntry, event: SpineEvent):
var event_name = event.get_data().get_event_name()
if event_name == "ready":
evil_coco2.get_animation_state().set_animation("idle", true)
func credits() -> void:
if OS.get_name() == "HTML5":
OS.shell_open("https://example.com")
#func _on_mouse_entered() -> void:
#Input.set_custom_mouse_cursor(load("res://assets/spine/out/cursor.png"))
#func _on_mouse_exited() -> void:
#Input.set_custom_mouse_cursor(null)
func crosshair(_delta):
crosshair_bone.global_position = get_viewport().get_mouse_position()
func is_right_mouse_click(event: InputEvent):
return event is InputEventMouseButton and event.button_index == 1
func play_sounds(sprite: SpineSprite, animation_state: SpineAnimationState, track_entry: SpineTrackEntry, event: SpineEvent):
var event_name = event.get_data().get_event_name()
if event_name == "open" and $open_sfx:
$open_sfx.play()
elif event_name == "close" and $close_sfx:
$close_sfx.play()
else:
return
#func animate_hand():
#var o = GDRx.on_input_as_observable(self)\
#.filter(func (e): return e is InputEventKey or e is InputEventMouseButton)\
#.subscribe(change_scene)\
#.dispose_with(self)
#func _ready() -> void:
#var gear = skeleton.find_slot("bb")
#animation_state.set_time_scale(time_scale)
#animation_state.set_animation("main/closing", false, 0)
#self.animation_event.connect(_on_animation_event)
func show_ui(_shape_idx: int) -> void:
ui.get_animation_state().set_animation("main/onopen", false, 0)
#gear_enter_area.hide()
#gear_leave_area.show()
func hide_ui(_shape_idx: int) -> void:
ui.get_animation_state().set_animation("main/onclose", false, 0)
#gear_enter_area.show()
#gear_leave_area.hide()
func set_skin(skin_choice: Globals.SkinChoices) -> void:
#var a = Globals.SkinChoices.find_key(skin_choice)
var slot: SpineSlot = evil_coco2.get_skeleton().find_slot("glasses")
var attch: SpineAttachment = evil_coco2.get_skeleton().get_attachment_by_slot_name("glasses", "nv_device")
slot.set_attachment(attch)
#var slots: Array = self.get_skeleton().get_slots()
#var skin = self.new_skin("default")
##for slot: SpineSlot in slots:
##print(slot.get_sequence_index(), " ", slot.get_attachment_state())
##var skin: SpineSkin = self.get_skeleton().get_skin()
#for key in Globals.current_choices:
#var a = skin.find_attachments_for_slot(key)
#print(a)
#print(skin.find_names_for_slot(slot.get_sequence_index()))
#func _ready() -> void:
#var gear = skeleton.find_slot("bb")
#animation_state.set_time_scale(time_scale)
#animation_state.set_animation("main/closing", false, 0)
#self.animation_event.connect(_on_animation_event)
#func _on_animation_event(sprite: SpineSprite, animation_state: SpineAnimationState, track_entry: SpineTrackEntry, event: SpineEvent):
#var event_name = event.get_data().get_event_name()
#if event_name == "open" and audio_stream_player2d:
#audio_stream_player2d.play()
#elif event_name == "close" and audio_stream_player2d:
#audio_stream_player2d.play()
#else:
#return

View File

@ -1,33 +1,56 @@
[gd_scene load_steps=11 format=3 uid="uid://vfi7tx6puk8f"]
[gd_scene load_steps=23 format=3 uid="uid://c837kn1e7luak"]
[ext_resource type="Shader" path="res://assets/scenes/bg.gdshader" id="1_ixjhk"]
[ext_resource type="Script" path="res://assets/scenes/main.gd" id="1_ecrjg"]
[ext_resource type="Shader" path="res://assets/shaders/bg.gdshader" id="1_ixjhk"]
[ext_resource type="Texture2D" uid="uid://c6r3b4befr4mp" path="res://assets/bitmaps/bubbles.png" id="2_on0kl"]
[ext_resource type="SpineAtlasResource" uid="uid://dy233woujcq5q" path="res://assets/spine/evilcoco_mount.atlas" id="3_rslsa"]
[ext_resource type="SpineSkeletonFileResource" uid="uid://ct2wsplxafjpe" path="res://assets/spine/evilcoco_mount.skel" id="4_etl44"]
[ext_resource type="Script" path="res://assets/scenes/spine_sprite.gd" id="5_d6oxx"]
[ext_resource type="PackedScene" uid="uid://dmxurk6lfka5g" path="res://assets/scenes/ui.tscn" id="9_l62o0"]
[ext_resource type="SpineAtlasResource" uid="uid://dxoeuw18xmsqy" path="res://assets/spine/evilcoco.atlas" id="4_t5cfc"]
[ext_resource type="SpineSkeletonFileResource" uid="uid://xmd724lyi37d" path="res://assets/spine/evilcoco.skel" id="5_04eq1"]
[ext_resource type="SpineAtlasResource" uid="uid://co5qu15dmcr67" path="res://assets/spine/nv_hand.atlas" id="8_4ptb2"]
[ext_resource type="SpineSkeletonFileResource" uid="uid://bjk0p3k2o0f77" path="res://assets/spine/nv_hand.skel" id="9_uo1s3"]
[ext_resource type="SpineAtlasResource" uid="uid://cnycxnfyyjkl" path="res://assets/spine/ui.atlas" id="10_r5qyy"]
[ext_resource type="SpineSkeletonFileResource" uid="uid://cfcrliusipr0s" path="res://assets/spine/ui.skel" id="11_1vujb"]
[ext_resource type="Script" path="res://assets/scenes/deleteme.gd" id="12_c32mg"]
[ext_resource type="AudioStream" uid="uid://dxhcikipxa08n" path="res://assets/spine/out/audio/open.wav" id="12_l3tkg"]
[ext_resource type="AudioStream" uid="uid://dwbxaigfj23wn" path="res://assets/spine/out/audio/close.wav" id="13_a3qwf"]
[ext_resource type="AudioStream" uid="uid://caok5ssdddedl" path="res://assets/spine/audio_raw/typical-trap-loop-2b-130751.mp3" id="14_exxjy"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8mp0w"]
shader = ExtResource("1_ixjhk")
shader_parameter/bottom_color = Color(0.415686, 0.0980392, 0.368627, 1)
shader_parameter/top_color = Color(0.0862745, 0.286275, 0.403922, 1)
shader_parameter/layer_count = 10
shader_parameter/time_scale = 0.019
shader_parameter/base_intensity = 0.375
shader_parameter/bottom_color = Color(0.879308, 0.597089, 3.85046e-07, 1)
shader_parameter/top_color = Color(0.960341, 0.442215, 0, 1)
shader_parameter/layer_count = 11
shader_parameter/time_scale = 0.2
shader_parameter/base_intensity = 0.5
shader_parameter/size = 1.0
shader_parameter/tex = ExtResource("2_on0kl")
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_fp7nn"]
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_pkoje"]
atlas_res = ExtResource("4_t5cfc")
skeleton_file_res = ExtResource("5_04eq1")
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_xq7at"]
atlas_res = ExtResource("3_rslsa")
skeleton_file_res = ExtResource("4_etl44")
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_bi8ad"]
atlas_res = ExtResource("8_4ptb2")
skeleton_file_res = ExtResource("9_uo1s3")
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_5ke1v"]
atlas_res = ExtResource("10_r5qyy")
skeleton_file_res = ExtResource("11_1vujb")
default_mix = 1.0
[sub_resource type="Environment" id="Environment_71opc"]
background_mode = 1
background_color = Color(0.842604, 0.404486, 0.626903, 1)
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_pdmnu"]
[node name="Node2D" type="Node"]
[node name="Main" type="Node"]
script = ExtResource("1_ecrjg")
[node name="Control" type="Control" parent="."]
layout_mode = 3
@ -35,13 +58,28 @@ anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="ColorRect" type="ColorRect" parent="Control"]
[node name="GearArea" type="Area2D" parent="Control"]
unique_name_in_owner = true
show_behind_parent = true
position = Vector2(-429, 717)
scale = Vector2(0.847294, 0.847293)
script = ExtResource("12_c32mg")
[node name="GearCollision" type="CollisionPolygon2D" parent="Control/GearArea"]
show_behind_parent = true
position = Vector2(-481.533, 112.122)
scale = Vector2(2.63333, 3.02785)
polygon = PackedVector2Array(-354.068, -58.0789, -292.218, -144.223, 171.656, -139.545, 234.402, -49.1137, 219.164, 22.2181, 138.49, 51.4525, -321.351, 50.2831)
[node name="BG" type="ColorRect" parent="Control"]
material = SubResource("ShaderMaterial_8mp0w")
layout_mode = 0
offset_left = -1340.0
offset_top = -967.0
offset_right = 1186.0
offset_bottom = 980.0
offset_left = -570.0
offset_top = -976.0
offset_right = 542.0
offset_bottom = 971.0
pivot_offset = Vector2(-38, 1462)
mouse_filter = 2
color = Color(1, 0.34902, 1, 1)
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="Control"]
@ -49,30 +87,67 @@ layout_mode = 2
offset_right = 700.0
offset_bottom = 615.0
[node name="EvilCoco2" type="SpineSprite" parent="Control/AspectRatioContainer"]
[node name="EvilCoco1" type="SpineSprite" parent="Control/AspectRatioContainer"]
unique_name_in_owner = true
position = Vector2(-2899, -788)
scale = Vector2(0.686894, 0.686894)
skeleton_data_res = SubResource("SpineSkeletonDataResource_fp7nn")
position = Vector2(-882, -941)
scale = Vector2(1.13171, 1.13171)
skeleton_data_res = SubResource("SpineSkeletonDataResource_pkoje")
preview_skin = "Default"
preview_animation = "-- Empty --"
preview_frame = false
preview_time = 0.0
script = ExtResource("5_d6oxx")
[node name="CrosshairBone" type="SpineBoneNode" parent="Control/AspectRatioContainer/EvilCoco2"]
[node name="CrosshairBone" type="SpineBoneNode" parent="Control/AspectRatioContainer/EvilCoco1"]
unique_name_in_owner = true
show_behind_parent = true
position = Vector2(368.469, -370.236)
rotation = -1.40981
position = Vector2(820.882, 804.977)
scale = Vector2(0.883619, 0.883619)
bone_name = "crosshair"
bone_mode = 1
[node name="EvilCoco2" type="SpineSprite" parent="Control/AspectRatioContainer"]
unique_name_in_owner = true
show_behind_parent = true
position = Vector2(50, 317)
scale = Vector2(0.777365, 0.777365)
skeleton_data_res = SubResource("SpineSkeletonDataResource_xq7at")
preview_skin = "Default"
preview_animation = "-- Empty --"
preview_frame = false
preview_time = 0.0
[node name="NVHand" type="SpineSprite" parent="Control/AspectRatioContainer"]
unique_name_in_owner = true
position = Vector2(-1852.43, -1694.76)
scale = Vector2(1.60198, 1.60198)
skeleton_data_res = SubResource("SpineSkeletonDataResource_bi8ad")
preview_skin = "Default"
preview_animation = "-- Empty --"
preview_frame = false
preview_time = 0.0
[node name="ColorRect" type="ColorRect" parent="Control/AspectRatioContainer"]
layout_mode = 2
size_flags_horizontal = 8
[node name="Ui" parent="Control" instance=ExtResource("9_l62o0")]
position = Vector2(-678, -1096)
[node name="UI" type="SpineSprite" parent="Control/AspectRatioContainer"]
unique_name_in_owner = true
position = Vector2(-417, 901)
rotation = -0.0593412
scale = Vector2(0.847294, 0.847293)
skeleton_data_res = SubResource("SpineSkeletonDataResource_5ke1v")
bounding_boxes = true
preview_skin = "Default"
preview_animation = "main/onopen"
preview_frame = true
preview_time = 1.03
[node name="UIBone" type="SpineBoneNode" parent="Control/AspectRatioContainer/UI"]
unique_name_in_owner = true
show_behind_parent = true
position = Vector2(889.378, -13.5009)
rotation = -1.44703
bone_name = "ui2"
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_71opc")
@ -80,7 +155,28 @@ camera_attributes = SubResource("CameraAttributesPractical_pdmnu")
[node name="Camera2D" type="Camera2D" parent="."]
[node name="open_sfx" type="AudioStreamPlayer2D" parent="."]
unique_name_in_owner = true
show_behind_parent = true
position = Vector2(-702.27, -707.749)
scale = Vector2(0.748685, 0.748684)
stream = ExtResource("12_l3tkg")
playback_type = 1
[node name="close_sfx" type="AudioStreamPlayer2D" parent="."]
unique_name_in_owner = true
show_behind_parent = true
position = Vector2(-702.27, -707.749)
scale = Vector2(0.748685, 0.748684)
stream = ExtResource("13_a3qwf")
playback_type = 1
[node name="fire_sfx" type="AudioStreamPlayer2D" parent="."]
position = Vector2(-954, 161)
volume_db = 10.0
autoplay = true
[node name="music" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("14_exxjy")
autoplay = true
parameters/looping = true

View File

@ -1,17 +0,0 @@
extends SpineSprite
@export var time_scale: float = 1.0
@onready var animation_state: SpineAnimationState = get_animation_state()
var o = GDRx.on_input_as_observable(self)\
.filter(func (e): return e is InputEventKey or e is InputEventMouseButton)\
.subscribe(change_scene)\
.dispose_with(self)
func _ready() -> void:
animation_state.set_animation("idle", true)
animation_state.set_time_scale(time_scale)
func change_scene(event: InputEvent):
await get_tree().create_timer(1.0).timeout
get_tree().change_scene_to_file("res://assets/scenes/main.tscn")
o.dispose()

View File

@ -1,59 +0,0 @@
{
"skeleton": {
"images": "/home/user/Projects/Games/EvilCocoGame1/assets/spine/out/"
},
"bones": [
{
"name": "root"
}
],
"slots": [
{
"name": "mount_evilcoco_hair",
"bone": "root",
"attachment": "mount_evilcoco_hair",
"blend": "normal"
},
{
"name": "mount_evilcoco_body",
"bone": "root",
"attachment": "mount_evilcoco_body",
"blend": "normal"
},
{
"name": "questionmark",
"bone": "root",
"attachment": "questionmark",
"blend": "normal"
}
],
"skins": {
"default": {
"mount_evilcoco_hair": {
"mount_evilcoco_hair": {
"x": 4186.0,
"y": -1303.5,
"width": 1080,
"height": 1615
}
},
"mount_evilcoco_body": {
"mount_evilcoco_body": {
"x": 4186.0,
"y": -1346.5,
"width": 1116,
"height": 1851
}
},
"questionmark": {
"questionmark": {
"x": 4162.5,
"y": -302.5,
"width": 103,
"height": 123
}
}
}
},
"animations": {}
}

View File

@ -1,45 +0,0 @@
class_name EvilCoco
extends SpineSprite
@export var time_scale: float = 1.0
@onready var animation_state: SpineAnimationState = get_animation_state()
@onready var crosshair_bone: SpineBoneNode = $CrosshairBone
var bounceS = GDRx.on_input_as_observable(self)\
.filter(func(event): return event is InputEventMouseButton)\
.subscribe(start_bounce)\
.dispose_with(self)
var crosshairS = GDRx.on_process_as_observable(self)\
.debounce(1)\
.subscribe(crosshair)\
.dispose_with(self)
func _ready() -> void:
animation_state.set_animation("idle", true)
animation_state.set_time_scale(time_scale)
Globals.evil_coco = self
#Input.set_custom_mouse_cursor(load("res://assets/bitmaps/icon.png"))
func crosshair(_delta):
crosshair_bone.global_position = get_viewport().get_mouse_position()
func start_bounce(event: InputEvent) -> void:
#if OS.get_name() == "HTML5":
#OS.shell_open("https://example.com")
#var e: InputEventMouseButton = event
animation_state.set_animation("animation", true)
bounceS.dispose()
func set_skin(skin_choice: Globals.SkinChoices) -> void:
#var a = Globals.SkinChoices.find_key(skin_choice)
var slot: SpineSlot = self.get_skeleton().find_slot("glasses")
var attch: SpineAttachment = self.get_skeleton().get_attachment_by_slot_name("glasses", "nv_device")
slot.set_attachment(attch)
#var slots: Array = self.get_skeleton().get_slots()
#var skin = self.new_skin("default")
##for slot: SpineSlot in slots:
##print(slot.get_sequence_index(), " ", slot.get_attachment_state())
##var skin: SpineSkin = self.get_skeleton().get_skin()
#for key in Globals.current_choices:
#var a = skin.find_attachments_for_slot(key)
#print(a)
#print(skin.find_names_for_slot(slot.get_sequence_index()))

4
assets/scenes/test.gd Normal file
View File

@ -0,0 +1,4 @@
extends Area2D
func _on_mouse_shape_entered(shape_idx: int) -> void:
print("test")

14
assets/scenes/test.tscn Normal file
View File

@ -0,0 +1,14 @@
[gd_scene load_steps=2 format=3 uid="uid://fpfgvqi3aptt"]
[ext_resource type="Script" path="res://assets/scenes/test.gd" id="1_uq0wm"]
[node name="Test" type="Node2D"]
[node name="Area2D" type="Area2D" parent="."]
disable_mode = 2
script = ExtResource("1_uq0wm")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Area2D"]
polygon = PackedVector2Array(1018, 806, 625, 340, 232, 748, 438, 1061)
[connection signal="mouse_shape_entered" from="Area2D" to="Area2D" method="_on_mouse_shape_entered"]

View File

@ -1,40 +0,0 @@
extends SpineSprite
@export var time_scale: float = 1.0
@export var option_selected: int = 0
#@export var ui: Array[SkinChoi "head", ]
@onready var animation_state: SpineAnimationState = get_animation_state()
@onready var audio_stream_player2d: AudioStreamPlayer2D = $open_sfx
@onready var skeleton: SpineSkeleton = get_skeleton()
@onready var skin: SpineSkin = get_skeleton().get_skin()
@onready var unhover_polygon: CollisionObject2D = $"Control/UI/Area2D/UnhoverPolygon"
func _ready() -> void:
var gear = skeleton.find_slot("bb")
animation_state.set_time_scale(time_scale)
animation_state.set_animation("main/closing", false, 0)
self.animation_event.connect(_on_animation_event)
func _on_color_rect_mouse_entered() -> void:
animation_state.set_animation("main/onopen", false, 0)
$"../ColorRect2".show()
$"../ColorRect".hide()
func _on_color_rect_2_mouse_exited() -> void:
animation_state.set_animation("main/onclose", false, 0)
$"../ColorRect2".hide()
$"../ColorRect".show()
func _on_animation_event(sprite: SpineSprite, animation_state: SpineAnimationState, track_entry: SpineTrackEntry, event: SpineEvent):
var event_name = event.get_data().get_event_name()
if event_name == "open" and audio_stream_player2d:
audio_stream_player2d.play()
elif event_name == "close" and audio_stream_player2d:
audio_stream_player2d.play()
else:
return
#print("Animation event: " + track_entry.get_animation().get_name() + ", " + event.get_data().get_event_name() )
#print("Int: ", str(event.get_data().get_int_value()) )
#print("Float: ", str(event.get_data().get_float_value()) )
#print("String: ", event.get_data().get_string_value() )

View File

@ -1,144 +0,0 @@
[gd_scene load_steps=10 format=3 uid="uid://dmxurk6lfka5g"]
[ext_resource type="SpineAtlasResource" uid="uid://cnycxnfyyjkl" path="res://assets/spine/ui.atlas" id="1_ii07j"]
[ext_resource type="SpineSkeletonFileResource" uid="uid://cfcrliusipr0s" path="res://assets/spine/ui.skel" id="2_u1q6k"]
[ext_resource type="AudioStream" uid="uid://6gvpo7123eim" path="res://assets/spine/out/audio/press.wav" id="2_yjoxk"]
[ext_resource type="Script" path="res://assets/scenes/ui.gd" id="3_lnp61"]
[ext_resource type="AudioStream" uid="uid://dxhcikipxa08n" path="res://assets/spine/out/audio/open.wav" id="4_ik0l8"]
[ext_resource type="AudioStream" uid="uid://dwbxaigfj23wn" path="res://assets/spine/out/audio/close.wav" id="5_bmtfv"]
[ext_resource type="Script" path="res://assets/scenes/button_choice.gd" id="7_jwrl2"]
[ext_resource type="AudioStream" uid="uid://caok5ssdddedl" path="res://assets/spine/audio_raw/typical-trap-loop-2b-130751.mp3" id="8_t25ki"]
[sub_resource type="SpineSkeletonDataResource" id="SpineSkeletonDataResource_pe2wv"]
atlas_res = ExtResource("1_ii07j")
skeleton_file_res = ExtResource("2_u1q6k")
default_mix = 1.0
[node name="Ui" type="Node2D"]
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_left = 365.0
offset_top = 1903.0
offset_right = 405.0
offset_bottom = 1943.0
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("8_t25ki")
autoplay = true
parameters/looping = true
[node name="AudioStreamPlayer2D2" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("2_yjoxk")
[node name="UISprite" type="SpineSprite" parent="."]
position = Vector2(226, 1844)
scale = Vector2(0.847294, 0.847293)
skeleton_data_res = SubResource("SpineSkeletonDataResource_pe2wv")
bounding_boxes = true
preview_skin = "Default"
preview_animation = "main/onopen"
preview_frame = true
preview_time = 1.03
script = ExtResource("3_lnp61")
time_scale = 2.0
[node name="open_sfx" type="AudioStreamPlayer2D" parent="UISprite"]
show_behind_parent = true
position = Vector2(-322.521, -1681.53)
scale = Vector2(0.883619, 0.883619)
stream = ExtResource("4_ik0l8")
playback_type = 1
[node name="close_sfx" type="AudioStreamPlayer2D" parent="UISprite"]
show_behind_parent = true
position = Vector2(-322.521, -1681.53)
scale = Vector2(0.883619, 0.883619)
stream = ExtResource("5_bmtfv")
playback_type = 1
[node name="SpineBoneNode" type="SpineBoneNode" parent="UISprite"]
show_behind_parent = true
[node name="ColorRect" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = -88.0
offset_top = 1589.0
offset_right = 377.0
offset_bottom = 2051.0
[node name="ColorRect2" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = -96.0
offset_top = 1064.0
offset_right = 1220.0
offset_bottom = 1818.0
[node name="Button1" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = 261.0
offset_top = 1743.0
offset_right = 394.0
offset_bottom = 1869.0
script = ExtResource("7_jwrl2")
[node name="Button2" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = 403.0
offset_top = 1754.0
offset_right = 536.0
offset_bottom = 1880.0
script = ExtResource("7_jwrl2")
choice = 1
[node name="Button3" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = 551.0
offset_top = 1763.0
offset_right = 684.0
offset_bottom = 1889.0
script = ExtResource("7_jwrl2")
choice = 2
[node name="Button4" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = 692.0
offset_top = 1773.0
offset_right = 825.0
offset_bottom = 1899.0
script = ExtResource("7_jwrl2")
choice = 3
[node name="Button5" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = 842.0
offset_top = 1777.0
offset_right = 975.0
offset_bottom = 1903.0
script = ExtResource("7_jwrl2")
choice = 4
[node name="Button6" type="ColorRect" parent="."]
visibility_layer = 0
offset_left = 983.0
offset_top = 1783.0
offset_right = 1116.0
offset_bottom = 1909.0
script = ExtResource("7_jwrl2")
choice = 5
[connection signal="mouse_entered" from="ColorRect" to="UISprite" method="_on_color_rect_mouse_entered"]
[connection signal="mouse_exited" from="ColorRect2" to="UISprite" method="_on_color_rect_2_mouse_exited"]
[connection signal="mouse_entered" from="Button1" to="Button1" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="Button1" to="Button1" method="_on_mouse_exited"]
[connection signal="mouse_entered" from="Button2" to="Button2" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="Button2" to="Button2" method="_on_mouse_exited"]
[connection signal="mouse_entered" from="Button3" to="Button3" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="Button3" to="Button3" method="_on_mouse_exited"]
[connection signal="mouse_entered" from="Button4" to="Button4" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="Button4" to="Button4" method="_on_mouse_exited"]
[connection signal="mouse_entered" from="Button5" to="Button5" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="Button5" to="Button5" method="_on_mouse_exited"]
[connection signal="mouse_entered" from="Button6" to="Button6" method="_on_mouse_entered"]
[connection signal="mouse_exited" from="Button6" to="Button6" method="_on_mouse_exited"]

View File

@ -1,8 +0,0 @@
extends Node2D
func _ready() -> void:
Globals.FaceChoices.GLASSES
pass # Replace with function body.
func _process(delta: float) -> void:
pass

View File

@ -1,13 +1,16 @@
evilcoco.png
size:1546,863
size:1648,863
filter:Linear,Linear
scale:0.5
ear ring
bounds:1359,356,62,97
bounds:1546,799,62,97
rotate:90
evil_coco_body
bounds:494,5,490,856
offsets:0,0,490,859
evil_coco_oppai
bounds:1359,109,287,309
offsets:0,2,287,311
evil_coco_oppai_body
bounds:2,2,490,859
hair

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 KiB

After

Width:  |  Height:  |  Size: 714 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cmrer4fvbcaa7"
path="res://.godot/imported/evil_coco_oppai.png-3bf317d332e172df398c8f07707c0395.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/spine/out/evil_coco_oppai.png"
dest_files=["res://.godot/imported/evil_coco_oppai.png-3bf317d332e172df398c8f07707c0395.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 25 KiB

BIN
assets/spine/out/ui2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -1,11 +1,11 @@
ui.png
size:825,209
size:857,218
filter:Linear,Linear
scale:0.5
cloud
bounds:2,24,50,40
gearb1
bounds:616,2,205,207
bounds:815,166,50,40
rotate:90
gearb1
bounds:616,19,197,197
ui1
bounds:2,66,612,141
bounds:2,2,612,214

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

View File

@ -11,7 +11,7 @@ config_version=5
[application]
config/name="EvilCocoTestGame1"
run/main_scene="res://assets/scenes/intro.tscn"
run/main_scene="res://assets/scenes/main.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://assets/bitmaps/icon.png"