progress
This commit is contained in:
parent
eecdb76bac
commit
2b2b5765da
6 changed files with 19 additions and 24 deletions
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=339 format=3 uid="uid://dlyt5o2dona1a"]
|
[gd_scene load_steps=336 format=3 uid="uid://dlyt5o2dona1a"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://d1de5fg4m1l34" path="res://characters/player/Player.gd" id="1_l3wc5"]
|
[ext_resource type="Script" uid="uid://d1de5fg4m1l34" path="res://characters/player/Player.gd" id="1_l3wc5"]
|
||||||
[ext_resource type="Script" uid="uid://bgvnlvv0wk71g" path="res://global/state_machine/StateMachine.gd" id="2_ae3rk"]
|
[ext_resource type="Script" uid="uid://bgvnlvv0wk71g" path="res://global/state_machine/StateMachine.gd" id="2_ae3rk"]
|
||||||
|
@ -80,9 +80,7 @@
|
||||||
[ext_resource type="Script" uid="uid://60wby2r3n4tx" path="res://global/camera/PlayerCamera2.gd" id="63_wa5ni"]
|
[ext_resource type="Script" uid="uid://60wby2r3n4tx" path="res://global/camera/PlayerCamera2.gd" id="63_wa5ni"]
|
||||||
[ext_resource type="Script" uid="uid://ddhsdf13or1da" path="res://global/state_machine/misc/JumpStats.gd" id="64_5bsmn"]
|
[ext_resource type="Script" uid="uid://ddhsdf13or1da" path="res://global/state_machine/misc/JumpStats.gd" id="64_5bsmn"]
|
||||||
[ext_resource type="Script" uid="uid://dbhp6ek2kwibq" path="res://global/camera/Limits.gd" id="65_8qlk8"]
|
[ext_resource type="Script" uid="uid://dbhp6ek2kwibq" path="res://global/camera/Limits.gd" id="65_8qlk8"]
|
||||||
[ext_resource type="Curve" uid="uid://ojnqamky0j8r" path="res://global/camera/default-camera-transition-curve.tres" id="65_xm768"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://d0wkusth6nbhh" path="res://global/camera/CameraProperties.tscn" id="66_8qlk8"]
|
[ext_resource type="PackedScene" uid="uid://d0wkusth6nbhh" path="res://global/camera/CameraProperties.tscn" id="66_8qlk8"]
|
||||||
[ext_resource type="Script" uid="uid://bmuu0n34auwaq" path="res://global/hacks/Float.gd" id="66_xm768"]
|
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="SpriteFrames_4lqx6"]
|
[sub_resource type="SpriteFrames" id="SpriteFrames_4lqx6"]
|
||||||
animations = [{
|
animations = [{
|
||||||
|
@ -3134,11 +3132,6 @@ top = -1e+07
|
||||||
bottom = 1e+07
|
bottom = 1e+07
|
||||||
metadata/_custom_type_script = "uid://dbhp6ek2kwibq"
|
metadata/_custom_type_script = "uid://dbhp6ek2kwibq"
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_40cv0"]
|
|
||||||
script = ExtResource("66_xm768")
|
|
||||||
value = 5.0
|
|
||||||
metadata/_custom_type_script = "uid://bmuu0n34auwaq"
|
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_w1mwi"]
|
[sub_resource type="Curve" id="Curve_w1mwi"]
|
||||||
_limits = [0.0, 300.0, 0.0, 1.0]
|
_limits = [0.0, 300.0, 0.0, 1.0]
|
||||||
_data = [Vector2(0.474308, 247.826), 0.0, 0.0, 0, 0]
|
_data = [Vector2(0.474308, 247.826), 0.0, 0.0, 0, 0]
|
||||||
|
@ -3285,10 +3278,8 @@ debug_show = true
|
||||||
fallback_properties = NodePath("../CameraProperties")
|
fallback_properties = NodePath("../CameraProperties")
|
||||||
|
|
||||||
[node name="CameraProperties" parent="." instance=ExtResource("66_8qlk8")]
|
[node name="CameraProperties" parent="." instance=ExtResource("66_8qlk8")]
|
||||||
transform_curve = ExtResource("65_xm768")
|
inherit_transform = true
|
||||||
limits = SubResource("Resource_55jfm")
|
limits = SubResource("Resource_55jfm")
|
||||||
smoothing = SubResource("Resource_40cv0")
|
|
||||||
smoothing_curve = ExtResource("65_xm768")
|
|
||||||
|
|
||||||
[node name="UI" type="CanvasLayer" parent="."]
|
[node name="UI" type="CanvasLayer" parent="."]
|
||||||
layer = 3
|
layer = 3
|
||||||
|
|
|
@ -4,8 +4,7 @@ class_name CameraProperties
|
||||||
## In the camera stack, all these values have to be set at some point.
|
## In the camera stack, all these values have to be set at some point.
|
||||||
|
|
||||||
## x: transition time, y: completeness of transition (0.0 to 1.0)
|
## x: transition time, y: completeness of transition (0.0 to 1.0)
|
||||||
@export var transform_curve: Curve = null
|
@export var inherit_transform: bool = false
|
||||||
@export var limits: Limits = null
|
@export var limits: Limits = null
|
||||||
@export var smoothing : Float = null
|
|
||||||
@export var smoothing_curve: Curve = null
|
@export var smoothing_curve: Curve = null
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
[gd_scene load_steps=2 format=3 uid="uid://d0wkusth6nbhh"]
|
[gd_scene load_steps=3 format=3 uid="uid://d0wkusth6nbhh"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dmhg22cbt8m0l" path="res://global/camera/CameraProperties.gd" id="1_ur3fr"]
|
[ext_resource type="Script" uid="uid://dmhg22cbt8m0l" path="res://global/camera/CameraProperties.gd" id="1_ur3fr"]
|
||||||
|
[ext_resource type="Curve" uid="uid://ojnqamky0j8r" path="res://global/camera/default-camera-transition-curve.tres" id="2_6itet"]
|
||||||
|
|
||||||
[node name="CameraProperties" type="Node2D"]
|
[node name="CameraProperties" type="Node2D"]
|
||||||
script = ExtResource("1_ur3fr")
|
script = ExtResource("1_ur3fr")
|
||||||
|
smoothing_curve = ExtResource("2_6itet")
|
||||||
|
|
|
@ -3,8 +3,6 @@ extends Node2D
|
||||||
## If enabled, takes control of viewport transform.
|
## If enabled, takes control of viewport transform.
|
||||||
@export var enabled := false
|
@export var enabled := false
|
||||||
|
|
||||||
var properties := ["transform", "smoothing", "limits"]
|
|
||||||
|
|
||||||
## The x distance which the camera looks away from the player in the direction
|
## The x distance which the camera looks away from the player in the direction
|
||||||
## the player is facing.
|
## the player is facing.
|
||||||
@export
|
@export
|
||||||
|
@ -72,8 +70,12 @@ func _get_camera(property: String, depth: int = 0):
|
||||||
if c == null:
|
if c == null:
|
||||||
_camera_stack.remove_at(index)
|
_camera_stack.remove_at(index)
|
||||||
else:
|
else:
|
||||||
var null_check_name = "transform_curve" if property == "transform" else property
|
if property == "transform" && c.inherit_transform:
|
||||||
if c[null_check_name] != null:
|
if current_depth <= 0:
|
||||||
|
return c
|
||||||
|
else:
|
||||||
|
current_depth -= 1
|
||||||
|
elif property == "limits" && c.limits != null:
|
||||||
if current_depth <= 0:
|
if current_depth <= 0:
|
||||||
return c
|
return c
|
||||||
else:
|
else:
|
||||||
|
@ -100,8 +102,9 @@ func _process(delta: float):
|
||||||
var target_node = _get_camera("transform")
|
var target_node = _get_camera("transform")
|
||||||
var target_pos = _clamp_with_limits(target_node.global_transform.origin, _get_camera("limits").limits, middle_offset)
|
var target_pos = _clamp_with_limits(target_node.global_transform.origin, _get_camera("limits").limits, middle_offset)
|
||||||
var target_transform = target_node.transform.translated(target_pos)
|
var target_transform = target_node.transform.translated(target_pos)
|
||||||
|
print(target_node)
|
||||||
|
|
||||||
var smoothing = _get_camera("smoothing").smoothing_curve.sample(_transition_progress)
|
var smoothing = _camera_stack[-1].smoothing_curve.sample(_transition_progress)
|
||||||
|
|
||||||
# interpolate between _current_transform and intermediate_transform
|
# interpolate between _current_transform and intermediate_transform
|
||||||
_current_transform = _current_transform.interpolate_with(target_transform, smoothing * delta)
|
_current_transform = _current_transform.interpolate_with(target_transform, smoothing * delta)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
[gd_scene load_steps=2 format=3 uid="uid://3lsm61dhxlow"]
|
[gd_scene load_steps=3 format=3 uid="uid://3lsm61dhxlow"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://ddk7mcwdblbf" path="res://global/camera/SceneCamera.gd" id="1_3a2m6"]
|
[ext_resource type="Script" uid="uid://ddk7mcwdblbf" path="res://global/camera/SceneCamera.gd" id="1_3a2m6"]
|
||||||
|
[ext_resource type="Curve" uid="uid://ojnqamky0j8r" path="res://global/camera/default-camera-transition-curve.tres" id="2_b51ax"]
|
||||||
|
|
||||||
[node name="SceneCamera" type="Node2D"]
|
[node name="SceneCamera" type="Node2D"]
|
||||||
script = ExtResource("1_3a2m6")
|
script = ExtResource("1_3a2m6")
|
||||||
|
smoothing_curve = ExtResource("2_b51ax")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=25 format=4 uid="uid://bepys2yg3mlfh"]
|
[gd_scene load_steps=24 format=4 uid="uid://bepys2yg3mlfh"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://3lsm61dhxlow" path="res://global/camera/SceneCamera.tscn" id="1_r6xmg"]
|
[ext_resource type="PackedScene" uid="uid://3lsm61dhxlow" path="res://global/camera/SceneCamera.tscn" id="1_r6xmg"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b1ctnt3wnsgj4" path="res://icon.svg" id="1_r51fb"]
|
[ext_resource type="Texture2D" uid="uid://b1ctnt3wnsgj4" path="res://icon.svg" id="1_r51fb"]
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
[ext_resource type="Shader" uid="uid://tibpqmkay46y" path="res://debug/shaders/wobbly.gdshader" id="4_o1bhb"]
|
[ext_resource type="Shader" uid="uid://tibpqmkay46y" path="res://debug/shaders/wobbly.gdshader" id="4_o1bhb"]
|
||||||
[ext_resource type="Texture2D" uid="uid://tfth34htn52n" path="res://expressive_stone.png" id="6_3t7se"]
|
[ext_resource type="Texture2D" uid="uid://tfth34htn52n" path="res://expressive_stone.png" id="6_3t7se"]
|
||||||
[ext_resource type="PackedScene" uid="uid://d0wkusth6nbhh" path="res://global/camera/CameraProperties.tscn" id="6_tdtq1"]
|
[ext_resource type="PackedScene" uid="uid://d0wkusth6nbhh" path="res://global/camera/CameraProperties.tscn" id="6_tdtq1"]
|
||||||
[ext_resource type="Curve" uid="uid://ojnqamky0j8r" path="res://global/camera/default-camera-transition-curve.tres" id="8_gawt8"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://sxcxj2sua5ho" path="res://characters/enemies/Bingus/Bingus.tscn" id="8_puapy"]
|
[ext_resource type="PackedScene" uid="uid://sxcxj2sua5ho" path="res://characters/enemies/Bingus/Bingus.tscn" id="8_puapy"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dwg8c17nqiep2" path="res://global/powerups/Powerup.tscn" id="9_r6xmg"]
|
[ext_resource type="PackedScene" uid="uid://dwg8c17nqiep2" path="res://global/powerups/Powerup.tscn" id="9_r6xmg"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bkh0o0gbpctui" path="res://global/saving/SaveSpot.tscn" id="10_tdtq1"]
|
[ext_resource type="PackedScene" uid="uid://bkh0o0gbpctui" path="res://global/saving/SaveSpot.tscn" id="10_tdtq1"]
|
||||||
|
@ -95,7 +94,7 @@ scale = Vector2(14.3203, 7.0625)
|
||||||
texture = ExtResource("6_3t7se")
|
texture = ExtResource("6_3t7se")
|
||||||
|
|
||||||
[node name="CameraProperties" parent="ExpressiveStone" instance=ExtResource("6_tdtq1")]
|
[node name="CameraProperties" parent="ExpressiveStone" instance=ExtResource("6_tdtq1")]
|
||||||
transform_curve = ExtResource("8_gawt8")
|
inherit_transform = true
|
||||||
|
|
||||||
[node name="ExpressiveStoneFocusZone" parent="." node_paths=PackedStringArray("camera") instance=ExtResource("4_dn1o1")]
|
[node name="ExpressiveStoneFocusZone" parent="." node_paths=PackedStringArray("camera") instance=ExtResource("4_dn1o1")]
|
||||||
position = Vector2(799, 469)
|
position = Vector2(799, 469)
|
||||||
|
@ -158,7 +157,6 @@ shape = SubResource("RectangleShape2D_ytue1")
|
||||||
|
|
||||||
[node name="NoLimitsCameraProperties" parent="NoLimitsFocusZone" instance=ExtResource("6_tdtq1")]
|
[node name="NoLimitsCameraProperties" parent="NoLimitsFocusZone" instance=ExtResource("6_tdtq1")]
|
||||||
limits = SubResource("Resource_gawt8")
|
limits = SubResource("Resource_gawt8")
|
||||||
smoothing_curve = ExtResource("8_gawt8")
|
|
||||||
|
|
||||||
[editable path="ExpressiveStoneFocusZone"]
|
[editable path="ExpressiveStoneFocusZone"]
|
||||||
[editable path="NoLimitsFocusZone"]
|
[editable path="NoLimitsFocusZone"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue