diff --git a/components/Bullets/Cogwheel.tscn b/components/Bullets/Cogwheel.tscn index 2a68f02..976c5d5 100644 --- a/components/Bullets/Cogwheel.tscn +++ b/components/Bullets/Cogwheel.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=3 uid="uid://cdv7drkq43mfe"] +[gd_scene load_steps=14 format=3 uid="uid://cdv7drkq43mfe"] [ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_mt0uq"] [ext_resource type="Script" uid="uid://cfe4nv832olhp" path="res://scripts/Contents/Bullets/Cogwheel.gd" id="2_cjmf3"] @@ -15,6 +15,63 @@ animations = [{ "speed": 5.0 }] +[sub_resource type="Animation" id="Animation_cjmf3"] +resource_name = "destroy" +length = 0.5 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("%texture/..:modulate:a") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0, 0), +"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 0, -0.16666667, 0.16666667, 0, 0), +"times": PackedFloat32Array(0, 0.5) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("%texture/..:scale:x") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(2, 0), +"points": PackedFloat32Array(1, 0, 0, 0.083333336, -0.16666667, 0, -0.07777778, 0.16666667, 0, 0), +"times": PackedFloat32Array(0, 0.5) +} + +[sub_resource type="Animation" id="Animation_d8ajx"] +length = 0.001 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("%texture/..:modulate:a") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("%texture/..:scale:x") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_d8ajx"] +_data = { +&"RESET": SubResource("Animation_d8ajx"), +&"destroy": SubResource("Animation_cjmf3") +} + [sub_resource type="CircleShape2D" id="CircleShape2D_cjmf3"] radius = 47.0 @@ -59,7 +116,7 @@ allowFriendlyDamage = null canDamageSelf = null autoSpawnAnimation = null autoLoopAnimation = null -autoDestroyAnimation = null +autoDestroyAnimation = true autoDestroyOnHitMap = null freeAfterSpawn = null knockback = null @@ -70,6 +127,11 @@ canDoDuplicate = null scale = Vector2(0.2, 0.2) sprite_frames = SubResource("SpriteFrames_cjmf3") +[node name="animator" parent="texture" index="0"] +libraries = { +&"": SubResource("AnimationLibrary_d8ajx") +} + [node name="hitbox" parent="." index="1"] visible = false shape = SubResource("CircleShape2D_cjmf3") diff --git a/scripts/Contents/Bullets/Cogwheel.gd b/scripts/Contents/Bullets/Cogwheel.gd index 2a8a7cd..8a1b86a 100644 --- a/scripts/Contents/Bullets/Cogwheel.gd +++ b/scripts/Contents/Bullets/Cogwheel.gd @@ -28,5 +28,11 @@ func applyDot(): func refract(newBullet: BulletBase, _entity: EntityBase, _index: int, _total: int, _lastBullet: float): if newBullet is CogwheelBullet: + newBullet.initialRotate = initialRotate + newBullet.rotateSpeed = initialRotate + return newBullet +func split(newBullet: BulletBase, _index: int, _total: int, _lastBullet: float): + if newBullet is CogwheelBullet: + newBullet.initialRotate = initialRotate newBullet.rotateSpeed = initialRotate return newBullet