mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:05:34 +00:00
Pattern inversion
This commit is contained in:
parent
019f7d7ca0
commit
690bae01bc
2 changed files with 34 additions and 9 deletions
|
|
@ -1,26 +1,36 @@
|
|||
[gd_resource type="Resource" script_class="BossPhase" load_steps=9 format=3 uid="uid://ccj0cqbveey8c"]
|
||||
[gd_resource type="Resource" script_class="BossPhase" load_steps=14 format=3 uid="uid://ccj0cqbveey8c"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/SimpleMovementPattern.cs" id="1_lw82i"]
|
||||
[ext_resource type="PackedScene" uid="uid://dohakkayqj4w2" path="res://Scenes/Weapons/Bullets/enemyBullet_green.tscn" id="1_o4um1"]
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/SpeedModifier.cs" id="2_8gbml"]
|
||||
[ext_resource type="Script" path="res://Scripts/AttackPatterns/SpiralPattern.cs" id="2_7268a"]
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/BossPhase.cs" id="3_o6234"]
|
||||
[ext_resource type="PackedScene" uid="uid://by2rk6gx67f7e" path="res://Scenes/Weapons/Bullets/enemyBullet_yellow.tscn" id="4_ruawj"]
|
||||
[ext_resource type="Script" path="res://Scripts/Resources/PatternGroup.cs" id="6_6mg1u"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_upj22"]
|
||||
script = ExtResource("1_lw82i")
|
||||
relativeTargetPosition = Vector2(0, 0)
|
||||
moveDuration = 1.0
|
||||
transitionType = 1
|
||||
easeType = 2
|
||||
WaitForCompletion = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_l3ln6"]
|
||||
script = ExtResource("2_8gbml")
|
||||
ModifierType = 1
|
||||
Easing = 0
|
||||
Invert = false
|
||||
MinimumSpeed = 10.0
|
||||
Easing = 1
|
||||
Invert = true
|
||||
MinimumSpeed = 20.0
|
||||
ScalingFactor = 10.0
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0v4v8"]
|
||||
script = ExtResource("2_7268a")
|
||||
BulletScene = ExtResource("1_o4um1")
|
||||
bulletSpeed = 80.0
|
||||
bulletCount = 9
|
||||
bulletCount = 12
|
||||
rotationSpeed = 0.0
|
||||
_rotationOffset = 50.0
|
||||
_rotationOffset = 45.0
|
||||
duration = 1.0
|
||||
burstInterval = 1.0
|
||||
spread = 180.0
|
||||
|
|
@ -32,9 +42,9 @@ WaitForCompletion = true
|
|||
script = ExtResource("2_7268a")
|
||||
BulletScene = ExtResource("4_ruawj")
|
||||
bulletSpeed = 80.0
|
||||
bulletCount = 9
|
||||
bulletCount = 12
|
||||
rotationSpeed = 0.0
|
||||
_rotationOffset = -50.0
|
||||
_rotationOffset = -45.0
|
||||
duration = 1.0
|
||||
burstInterval = 1.0
|
||||
spread = 180.0
|
||||
|
|
@ -42,7 +52,20 @@ owner = 2
|
|||
_modifier = SubResource("Resource_l3ln6")
|
||||
WaitForCompletion = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_gm1rv"]
|
||||
script = ExtResource("6_6mg1u")
|
||||
patterns = Array[Resource]([SubResource("Resource_0v4v8"), SubResource("Resource_7yi74"), SubResource("Resource_0v4v8"), SubResource("Resource_7yi74"), SubResource("Resource_0v4v8"), SubResource("Resource_7yi74")])
|
||||
WaitForCompletion = true
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5fq8v"]
|
||||
script = ExtResource("1_lw82i")
|
||||
relativeTargetPosition = Vector2(-50, 20)
|
||||
moveDuration = 1.0
|
||||
transitionType = 1
|
||||
easeType = 2
|
||||
WaitForCompletion = true
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_o6234")
|
||||
Threshold = 800
|
||||
Patterns = Array[Resource]([SubResource("Resource_0v4v8"), SubResource("Resource_7yi74")])
|
||||
Patterns = Array[Resource]([SubResource("Resource_upj22"), SubResource("Resource_gm1rv"), SubResource("Resource_5fq8v"), SubResource("Resource_gm1rv")])
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ public partial class SpeedModifier : Resource, IBulletModifier
|
|||
return baseSpeed;
|
||||
|
||||
float t = (float)bulletIndex / (totalBullets - 1); // Normalize to [0,1]
|
||||
if (Invert)
|
||||
t = 1 - t;
|
||||
t = ApplyEasing(t);
|
||||
|
||||
return Mathf.Lerp(MinimumSpeed, baseSpeed, t);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue