mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:45:33 +00:00
Fixes for prisms
This commit is contained in:
parent
dbb81b7642
commit
f25bce557d
3 changed files with 45 additions and 32 deletions
|
|
@ -21,8 +21,8 @@ _name = "Intro"
|
|||
[sub_resource type="Resource" id="Resource_cfhv5"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0k62o"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -34,8 +34,8 @@ StartData = SubResource("Resource_cfhv5")
|
|||
[sub_resource type="Resource" id="Resource_tpb7s"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_edoov"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -47,8 +47,8 @@ StartData = SubResource("Resource_tpb7s")
|
|||
[sub_resource type="Resource" id="Resource_1sw5g"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 255
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_47bot"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -61,7 +61,7 @@ StartData = SubResource("Resource_1sw5g")
|
|||
script = ExtResource("1_ov731")
|
||||
EggIndex = 2
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([ExtResource("3_fydgr"), ExtResource("4_38yta"), ExtResource("5_em757"), ExtResource("6_sdmg8")])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mgdm6"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -79,8 +79,8 @@ _name = "Rebel Base"
|
|||
[sub_resource type="Resource" id="Resource_maxpt"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pein5"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -117,7 +117,7 @@ _name = "Default Scene"
|
|||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([ExtResource("7_b3oo5")])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = []
|
||||
|
||||
[sub_resource type="Resource" id="Resource_6ijnv"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -136,8 +136,8 @@ metadata/_custom_type_script = "uid://dnthdjrx78u6m"
|
|||
[sub_resource type="Resource" id="Resource_7sue8"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 255
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
metadata/_custom_type_script = "uid://mja0rk7n2kln"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ognca"]
|
||||
|
|
@ -151,8 +151,8 @@ metadata/_custom_type_script = "uid://dnthdjrx78u6m"
|
|||
[sub_resource type="Resource" id="Resource_olpjo"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
RemoveEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
StartingEquipment = []
|
||||
RemoveEquipment = []
|
||||
metadata/_custom_type_script = "uid://mja0rk7n2kln"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_nbnej"]
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -8,6 +8,12 @@ public partial class Prism : Area2D
|
|||
[Export] public float RotationSpeed { get; set; } = 0f;
|
||||
|
||||
private Sprite2D _sprite;
|
||||
|
||||
[Export] public float[] Angles { get; set; } = [-90f, -45f, 180f, 45f, 90f];
|
||||
|
||||
private int _angleIndex = 0;
|
||||
|
||||
private double _rotateTimer = 0;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
|
|
@ -22,13 +28,25 @@ public partial class Prism : Area2D
|
|||
{
|
||||
if (RotationSpeed > 0)
|
||||
{
|
||||
var angleDifference = (float)(RotationSpeed * delta);
|
||||
var newAngle = ReflectionAngle + angleDifference;
|
||||
if (newAngle > 360)
|
||||
_rotateTimer += delta;
|
||||
}
|
||||
|
||||
if (_rotateTimer > RotationSpeed)
|
||||
{
|
||||
_rotateTimer = 0;
|
||||
_angleIndex++;
|
||||
if (_angleIndex >= Angles.Length)
|
||||
{
|
||||
newAngle = 0;
|
||||
|
||||
_angleIndex = 0;
|
||||
}
|
||||
//var angleDifference = (float)(RotationSpeed * delta);
|
||||
//var newAngle = ReflectionAngle + angleDifference;
|
||||
// if (newAngle > 360)
|
||||
// {
|
||||
// newAngle = 0;
|
||||
//
|
||||
// }
|
||||
var newAngle = Angles[_angleIndex];
|
||||
SetReflectionAngle(newAngle);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue