More animations

- Implemented firebolt animation
- Started on icy wind animation
- Added animation to health bars
- Improved the animation system more
- Cleaned up some code
This commit is contained in:
nc5432 2024-05-14 21:40:18 -04:00
parent 847a41eaad
commit 69008d0046
20 changed files with 2226 additions and 259 deletions

View File

@ -1,15 +1,16 @@
[gd_resource type="Resource" script_class="Spellbook" load_steps=5 format=3 uid="uid://bxtiv2esuer8v"]
[gd_resource type="Resource" script_class="Spellbook" load_steps=6 format=3 uid="uid://bxtiv2esuer8v"]
[ext_resource type="Script" path="res://Resources/spellbook.gd" id="1_t8h8m"]
[ext_resource type="Resource" uid="uid://1xbik4qndtkh" path="res://Resources/Spells/firebolt.tres" id="2_ln222"]
[ext_resource type="Resource" uid="uid://dl6nv6lp460n3" path="res://Resources/Spells/rockThrow.tres" id="3_ocgmh"]
[ext_resource type="Resource" uid="uid://bmpu6k55bckdv" path="res://Resources/Spells/fireball.tres" id="4_kv0hs"]
[ext_resource type="Resource" uid="uid://c6mwbnutxm3vb" path="res://Resources/Spells/icyWind.tres" id="5_eymrm"]
[resource]
script = ExtResource("1_t8h8m")
name = "Old Book"
description = "An old spellbook you found on the side of the road"
spells = Array[Resource("res://Resources/spell.gd")]([ExtResource("2_ln222"), ExtResource("3_ocgmh"), ExtResource("4_kv0hs")])
spells = Array[Resource("res://Resources/spell.gd")]([ExtResource("2_ln222"), ExtResource("3_ocgmh"), ExtResource("4_kv0hs"), ExtResource("5_eymrm")])
damageMod = 1.0
defenseMod = 1.0
element = 0

View File

@ -1,13 +1,15 @@
[gd_resource type="Resource" script_class="Spellbook" load_steps=3 format=3 uid="uid://g86hap7s43n8"]
[gd_resource type="Resource" script_class="Spellbook" load_steps=5 format=3 uid="uid://g86hap7s43n8"]
[ext_resource type="Script" path="res://Resources/spellbook.gd" id="1_pn4te"]
[ext_resource type="Resource" uid="uid://dl6nv6lp460n3" path="res://Resources/Spells/rockThrow.tres" id="2_ofx8j"]
[ext_resource type="Resource" uid="uid://bmpu6k55bckdv" path="res://Resources/Spells/fireball.tres" id="3_brupg"]
[ext_resource type="Resource" uid="uid://1xbik4qndtkh" path="res://Resources/Spells/firebolt.tres" id="4_chcd4"]
[resource]
script = ExtResource("1_pn4te")
name = "Wizard Spellbook"
description = "A spellbook used by wizards"
spells = Array[Resource("res://Resources/spell.gd")]([ExtResource("2_ofx8j")])
spells = Array[Resource("res://Resources/spell.gd")]([ExtResource("2_ofx8j"), ExtResource("3_brupg"), ExtResource("4_chcd4")])
damageMod = 1.2
defenseMod = 1.2
element = 0

View File

@ -8,11 +8,10 @@ script = ExtResource("1_r2m62")
icon = ExtResource("1_0yb3x")
name = "Icy Wind"
description = "Blows frigid wind at your opponent"
animation = ""
animation = "res://Scenes/Animations/icyWindAnim.tscn"
damage = 4.0
backfireStrength = 2.0
castCombo = Array[String](["left", "left", "left", "down", "left"])
castProgress = 0
element = 2
stunning = false
timeout = 5.0

View File

@ -6,10 +6,10 @@ class_name Playlist
var randomized: Array[int]
var index: int = 0
func init(randomize: bool) -> void:
func init(randomify: bool) -> void:
for i in range(music.size()):
randomized.append(i)
if randomize:
if randomify:
shuffle()
func getNext() -> String:
@ -20,7 +20,7 @@ func getNext() -> String:
return ret
func shuffle() -> void:
var shuffled: Array[int]
var shuffled: Array[int] = []
for i in range(randomized.size()):
var x: int = randomized.pick_random()
randomized.erase(x)

View File

@ -456,6 +456,209 @@ animations = [{
"speed": 60.0
}]
[sub_resource type="Animation" id="Animation_wgnw8"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(253, 241)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0.2, 0.2)]
}
[sub_resource type="Animation" id="Animation_wf5px"]
resource_name = "attackInverse0"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(890, 283), Vector2(890, 241)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(1e-05, 1e-05), Vector2(0.2, 0.2)]
}
[sub_resource type="Animation" id="Animation_yy8ft"]
resource_name = "attackInverse1"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(890, 241), Vector2(890, 210)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0.2, 0.2), Vector2(0.6, 0.6)]
}
[sub_resource type="Animation" id="Animation_v42n0"]
resource_name = "attackInverse2"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(890, 210), Vector2(890, 146)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0.6, 0.6), Vector2(1, 1)]
}
[sub_resource type="Animation" id="Animation_vxtqp"]
resource_name = "attackInverse3"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(890, 146), Vector2(890, 104)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(2.2, 2.2)]
}
[sub_resource type="Animation" id="Animation_if6re"]
resource_name = "attackInverse4"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(2.2, 2.2), Vector2(3.4, 3.4)]
}
[sub_resource type="Animation" id="Animation_y406p"]
resource_name = "attackInverse5"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(3.4, 3.4), Vector2(4.8, 4.8)]
}
[sub_resource type="Animation" id="Animation_et7ce"]
resource_name = "attackInverse6"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(4.8, 4.8), Vector2(7, 7)]
}
[sub_resource type="Animation" id="Animation_e75l3"]
resource_name = "attackInverse7"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(890, 104), Vector2(250, 286)]
}
[sub_resource type="Animation" id="Animation_r8anb"]
resource_name = "attackSegment0"
length = 0.1
@ -486,7 +689,7 @@ tracks/1/keys = {
[sub_resource type="Animation" id="Animation_7m6oo"]
resource_name = "attackSegment1"
length = 0.2
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
@ -494,7 +697,7 @@ tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2),
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(253, 241), Vector2(253, 210)]
@ -506,7 +709,7 @@ tracks/1/path = NodePath("AnimatedSprite2D:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.2),
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0.2, 0.2), Vector2(0.6, 0.6)]
@ -632,57 +835,6 @@ tracks/0/keys = {
"values": [Vector2(253, 104), Vector2(896, 286)]
}
[sub_resource type="Animation" id="Animation_wf5px"]
resource_name = "attackInverse0"
[sub_resource type="Animation" id="Animation_yy8ft"]
resource_name = "attackInverse1"
[sub_resource type="Animation" id="Animation_v42n0"]
resource_name = "attackInverse2"
[sub_resource type="Animation" id="Animation_vxtqp"]
resource_name = "attackInverse3"
[sub_resource type="Animation" id="Animation_if6re"]
resource_name = "attackInverse4"
[sub_resource type="Animation" id="Animation_y406p"]
resource_name = "attackInverse5"
[sub_resource type="Animation" id="Animation_et7ce"]
resource_name = "attackInverse6"
[sub_resource type="Animation" id="Animation_e75l3"]
resource_name = "attackInverse7"
[sub_resource type="Animation" id="Animation_wgnw8"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(253, 241)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimatedSprite2D:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0.2, 0.2)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_r6j4e"]
_data = {
"RESET": SubResource("Animation_wgnw8"),

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,560 @@
[gd_scene load_steps=19 format=3 uid="uid://cby0hie21caqv"]
[ext_resource type="Script" path="res://Scripts/Animations/icyWindAnim.gd" id="1_aonld"]
[ext_resource type="Texture2D" uid="uid://vfd8mkmxtqxq" path="res://Sprites/Particles/Particles Cleaned/12_nebula_spritesheet.png" id="2_onmly"]
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_ebtcy"]
particles_animation = true
particles_anim_h_frames = 8
particles_anim_v_frames = 8
particles_anim_loop = false
[sub_resource type="Curve" id="Curve_yaeb4"]
_data = [Vector2(0, 0), 0.0, 3.47985, 0, 0, Vector2(0.133333, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -3.03297, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_f1cta"]
curve = SubResource("Curve_yaeb4")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7lscu"]
particle_flag_disable_z = true
emission_shape = 6
emission_ring_axis = Vector3(0, 0, 1)
emission_ring_height = 1.0
emission_ring_radius = 80.0
emission_ring_inner_radius = 40.0
spread = 10.0
orbit_velocity_min = 0.01
orbit_velocity_max = 0.2
gravity = Vector3(0, 0, 0)
radial_accel_min = -500.0
radial_accel_max = -500.0
scale_min = 0.1
scale_max = 0.3
scale_curve = SubResource("CurveTexture_f1cta")
hue_variation_min = -0.01
hue_variation_max = 0.01
anim_speed_min = 1.0
anim_speed_max = 1.0
turbulence_enabled = true
turbulence_noise_strength = 10.0
turbulence_noise_scale = 0.3
turbulence_noise_speed = Vector3(1, 0, 0)
turbulence_noise_speed_random = 0.83
turbulence_influence_min = 0.0
turbulence_influence_max = 0.069
[sub_resource type="Animation" id="Animation_whisc"]
resource_name = "attackSegment0"
length = 0.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("GPUParticles2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(298, 354)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("GPUParticles2D:process_material:radial_accel_min")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [-500.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("GPUParticles2D:process_material:radial_accel_max")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [-500.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("GPUParticles2D:speed_scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("GPUParticles2D:process_material:initial_velocity_min")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("GPUParticles2D:process_material:initial_velocity_max")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("GPUParticles2D:process_material:orbit_velocity_min")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.01]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("GPUParticles2D:process_material:orbit_velocity_max")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.2]
}
tracks/8/type = "value"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("GPUParticles2D:process_material:turbulence_enabled")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/9/type = "value"
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/path = NodePath("GPUParticles2D:amount")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [25]
}
[sub_resource type="Animation" id="Animation_btcxw"]
resource_name = "attackSegment1"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("GPUParticles2D:amount")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [25, 30]
}
[sub_resource type="Animation" id="Animation_1m0sq"]
resource_name = "attackSegment2"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("GPUParticles2D:process_material:scale_min")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.1, 0.2]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("GPUParticles2D:process_material:scale_max")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.3, 0.4]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("GPUParticles2D:amount")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [30, 40]
}
[sub_resource type="Animation" id="Animation_tuh2j"]
resource_name = "attackSegment3"
length = 0.15
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("GPUParticles2D:process_material:scale_min")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.2]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("GPUParticles2D:process_material:scale_max")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.3]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("GPUParticles2D:amount")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [40]
}
[sub_resource type="Animation" id="Animation_3rbnj"]
resource_name = "attackSegment4"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("GPUParticles2D:process_material:radial_accel_min")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [-500.0, 0.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("GPUParticles2D:process_material:radial_accel_max")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [-500.0, 0.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("GPUParticles2D:process_material:orbit_velocity_min")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("GPUParticles2D:process_material:orbit_velocity_max")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("GPUParticles2D:process_material:turbulence_enabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("GPUParticles2D:process_material:initial_velocity_min")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [650.0]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("GPUParticles2D:process_material:initial_velocity_max")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [850.0]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("GPUParticles2D:amount")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0.1),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [50]
}
[sub_resource type="Animation" id="Animation_jpbb4"]
resource_name = "attackInverse0"
[sub_resource type="Animation" id="Animation_nbfl1"]
resource_name = "attackInverse1"
[sub_resource type="Animation" id="Animation_jratu"]
resource_name = "attackInverse2"
[sub_resource type="Animation" id="Animation_ho3ab"]
resource_name = "attackInverse3"
[sub_resource type="Animation" id="Animation_xvjql"]
resource_name = "attackInverse4"
[sub_resource type="Animation" id="Animation_lrc75"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("GPUParticles2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(298, 354)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("GPUParticles2D:process_material:radial_accel_min")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [-500.0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("GPUParticles2D:process_material:radial_accel_max")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [-500.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("GPUParticles2D:speed_scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("GPUParticles2D:process_material:initial_velocity_max")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("GPUParticles2D:process_material:initial_velocity_min")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("GPUParticles2D:process_material:scale_min")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.1]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("GPUParticles2D:process_material:scale_max")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.3]
}
tracks/8/type = "value"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("GPUParticles2D:process_material:orbit_velocity_min")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.01]
}
tracks/9/type = "value"
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/path = NodePath("GPUParticles2D:process_material:orbit_velocity_max")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.2]
}
tracks/10/type = "value"
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/path = NodePath("GPUParticles2D:process_material:turbulence_enabled")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/11/type = "value"
tracks/11/imported = false
tracks/11/enabled = true
tracks/11/path = NodePath("GPUParticles2D:amount")
tracks/11/interp = 1
tracks/11/loop_wrap = true
tracks/11/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [25]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5xdsw"]
_data = {
"RESET": SubResource("Animation_lrc75"),
"attackInverse0": SubResource("Animation_jpbb4"),
"attackInverse1": SubResource("Animation_nbfl1"),
"attackInverse2": SubResource("Animation_jratu"),
"attackInverse3": SubResource("Animation_ho3ab"),
"attackInverse4": SubResource("Animation_xvjql"),
"attackSegment0": SubResource("Animation_whisc"),
"attackSegment1": SubResource("Animation_btcxw"),
"attackSegment2": SubResource("Animation_1m0sq"),
"attackSegment3": SubResource("Animation_tuh2j"),
"attackSegment4": SubResource("Animation_3rbnj")
}
[node name="icyWindAnim" type="Node2D"]
script = ExtResource("1_aonld")
finalIndex = 5
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
material = SubResource("CanvasItemMaterial_ebtcy")
position = Vector2(298, 354)
amount = 25
process_material = SubResource("ParticleProcessMaterial_7lscu")
texture = ExtResource("2_onmly")
lifetime = 3.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_5xdsw")
}
[connection signal="animation_finished" from="AnimationPlayer" to="." method="animFinished"]

View File

@ -1,15 +1,9 @@
[gd_scene load_steps=15 format=3 uid="uid://c44hesqr12wxd"]
[gd_scene load_steps=14 format=3 uid="uid://c44hesqr12wxd"]
[ext_resource type="Script" path="res://Scripts/Animations/rockThrowAnim.gd" id="1_owh0v"]
[ext_resource type="Texture2D" uid="uid://dwsd0hggrxbdq" path="res://Sprites/Animations/Rock Pack/Rocks 64x64 by Captainskeleto.png" id="2_addwy"]
[ext_resource type="Resource" uid="uid://dl6nv6lp460n3" path="res://Resources/Spells/rockThrow.tres" id="2_apcu7"]
[sub_resource type="Curve2D" id="Curve2D_m36l3"]
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 30, 39, 0, 0, 0, 0, 69, 45, 0, 0, 0, 0, 114, 61, 0, 0, 0, 0, 164, 98, 0, 0, 0, 0, 217, 179, 0, 0, 0, 0, 258, 318, 0, 0, 0, 0, 272, 436, 0, 0, 0, 0, 281, 600)
}
point_count = 8
[sub_resource type="AtlasTexture" id="AtlasTexture_wqvpx"]
atlas = ExtResource("2_addwy")
region = Rect2(128, 192, 64, 64)
@ -145,16 +139,6 @@ script = ExtResource("1_owh0v")
finalIndex = 3
spell = ExtResource("2_apcu7")
[node name="Path2D2" type="Path2D" parent="."]
position = Vector2(339, 632)
curve = SubResource("Curve2D_m36l3")
[node name="PathFollow2D" type="PathFollow2D" parent="Path2D2"]
position = Vector2(30, 39)
rotation = 0.152649
rotates = false
loop = false
[node name="TextureRect" type="TextureRect" parent="."]
anchors_preset = 8
anchor_left = 0.5

File diff suppressed because one or more lines are too long

View File

@ -2,17 +2,10 @@ extends AnimationBase
@export var explodeDur: float = 0.2
@onready var ballofayr: AnimatedSprite2D = $AnimatedSprite2D
@onready var animationPlayer: AnimationPlayer = $AnimationPlayer
@onready var particles: GPUParticles2D = $GPUParticles2D
var exploding: bool = false
var timer: float = 0
var size: Vector2 = Vector2(0, 0)
# Called when the node enters the scene tree for the first time.
func _ready():
if inverted:
attackName = inverseName
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
@ -21,25 +14,9 @@ func _process(delta):
if timer > explodeDur:
self.queue_free()
func setProgress(target: float, final: float = finalProg) -> void:
targetProg = target
finalProg = final
if (index > -1):
animationPlayer.queue(attackName + str(index))
index += 1
func explode() -> void:
func die() -> void:
particles.position = ballofayr.position
ballofayr.hide()
particles.emitting = true
exploding = true
timer = 0
func animFinished(s: String):
print("Animation finished with indices " + str(index) + " and " + str(finalIndex))
if (index == finalIndex):
animationFinished.emit(spell)
explode()
func castFailed() -> void:
explode()

View File

@ -1,11 +1,17 @@
extends "res://Scripts/animationBase.gd"
@onready var texture: AnimatedSprite2D = $AnimatedSprite2D
# Called when the node enters the scene tree for the first time.
func _ready():
pass
var exploding: bool = false
func animFinished(_s: String):
if (!exploding && index == finalIndex):
animationFinished.emit(spell)
die()
elif (exploding):
queue_free()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func die() -> void:
exploding = true
animationPlayer.stop()
animationPlayer.play("die")

View File

@ -0,0 +1,7 @@
extends AnimationBase
@onready var particles: GPUParticles2D = $GPUParticles2D
func die():
animationPlayer.play("RESET")
queue_free()

View File

@ -1,27 +1,9 @@
extends AnimationBase
@onready var texture: TextureRect = $TextureRect
@onready var animationPlayer: AnimationPlayer = $AnimationPlayer
var failIndex: int = 0
var animQueue: Queue = Queue.new()
# Called when the node enters the scene tree for the first time.
func _ready():
if inverted:
attackName = inverseName
func castFailed() -> void:
queue_free()
func setProgress(target: float, final: float = finalProg) -> void:
targetProg = target
finalProg = final
if (index > -1):
animationPlayer.queue(attackName + str(index))
index += 1
func animFinished(s: String):
if (index == finalIndex):
animationFinished.emit(spell)
queue_free()

View File

@ -6,10 +6,6 @@ extends GPUParticles2D
func _ready():
process_material.emission_box_extents = size
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_mouse_entered():
emitting = true

View File

@ -12,7 +12,7 @@ func home():
titleScreen.show()
func changeDifficulty(i: int):
data.difficulty = i
data.difficulty = i as Data.Difficulty
func changeVolMaster(i: float):
AudioServer.set_bus_volume_db(mainBus, linear_to_db(i))

View File

@ -16,14 +16,6 @@ extends Control
@export var arena: String
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_play_pressed():
var a: Node2D = load(arena).instantiate()
$/root/Root.add_child(a)

View File

@ -2,6 +2,8 @@ class_name AnimationBase extends Node2D
signal animationFinished(spell: Spell)
@onready var animationPlayer: AnimationPlayer = $AnimationPlayer
@export var inverted: bool = false
@export var index: int = -1
@export var finalIndex: int = 0
@ -12,9 +14,25 @@ var inverseName: String = "attackInverse"
var targetProg: float
var finalProg: float
# Called when the node enters the scene tree for the first time.
func _ready():
if inverted:
attackName = inverseName
func castFailed() -> void:
pass
die()
func setProgress(target: float, final: float = finalProg) -> void:
targetProg = target
finalProg = final
if (index > -1):
animationPlayer.queue(attackName + str(index))
index += 1
func animFinished(_s: String):
if (index == finalIndex):
animationFinished.emit(spell)
die()
func die():
queue_free()

View File

@ -1,5 +1,5 @@
extends RichTextLabel
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
func _physics_process(_delta):
text = "FPS: " + str(Engine.get_frames_per_second())

View File

@ -3,5 +3,11 @@ class_name HealthBar extends Control
@onready var bar: ColorRect = $ColorRect2
@export var maxHealth: float = 1
var barSize: Vector2 = Vector2(20, 100)
var tween: Tween
func healthChanged(health) -> void:
bar.size.y = (health / maxHealth) * 100
if (tween): tween.kill()
tween = create_tween()
barSize.y = (health / maxHealth) * 100
tween.tween_property(bar, "size", barSize, 0.3)

View File

@ -31,7 +31,9 @@ func _process(delta):
spellIndex = i
castIndicator.show()
castIndicator.setDirs(spell.castCombo[0], spell.castCombo[1])
print(spell.animation)
anim = data.animations[spell.animation].instantiate()
print(anim.name)
anim.setProgress(0, spell.castCombo.size())
anim.spell = spell
anim.connect("animationFinished", avatar.finalizeSpell)