Compare commits
2 commits
8740b632a1
...
2d2b63fd74
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d2b63fd74 | |||
| beb0b697ea |
6 changed files with 20 additions and 3 deletions
11
bg_image.gd
Normal file
11
bg_image.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
extends TextureRect
|
||||||
|
|
||||||
|
@export var colors : Array[Color] = [Color(0.3, 1, 1) * 0.7, Color(1, 0.6, 0.6) * 0.7, Color(1, 1, 1) * 0.7]
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
var index : int = floor((%Player.position.angle() + PI)/ TAU * colors.size())
|
||||||
|
var diff = (%Player.position.angle() + PI)/ TAU * colors.size() - index
|
||||||
|
self.modulate = linear_color_interpolation(colors[index], colors[(index + 1) % colors.size()], diff)
|
||||||
|
|
||||||
|
func linear_color_interpolation(c1 : Color, c2 : Color, t : float):
|
||||||
|
return c1 + (c2 - c1) * t
|
||||||
1
bg_image.gd.uid
Normal file
1
bg_image.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://gul4u5tw1vxk
|
||||||
|
|
@ -37,6 +37,7 @@ script = ExtResource("1_6attn")
|
||||||
[node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("2_34o1m")]
|
[node name="EnemyHurtbox" parent="." node_paths=PackedStringArray("canvasItem") instance=ExtResource("2_34o1m")]
|
||||||
max_hp = 50
|
max_hp = 50
|
||||||
canvasItem = NodePath("..")
|
canvasItem = NodePath("..")
|
||||||
|
id_block_time = 0.2
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyHurtbox"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyHurtbox"]
|
||||||
scale = Vector2(6, 6)
|
scale = Vector2(6, 6)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=15 format=3 uid="uid://cxo6bq26huau7"]
|
[gd_scene load_steps=16 format=3 uid="uid://cxo6bq26huau7"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="3_kek77"]
|
[ext_resource type="Texture2D" uid="uid://d3fpq76anm4t7" path="res://world/Background Prototype/Background prototype.png" id="3_kek77"]
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
[ext_resource type="Script" uid="uid://cpaskpj67pnaj" path="res://enemies/boss/boss_spawner.gd" id="10_efxa6"]
|
[ext_resource type="Script" uid="uid://cpaskpj67pnaj" path="res://enemies/boss/boss_spawner.gd" id="10_efxa6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cqn67nwyrtq3k" path="res://ui/journal/journal.tscn" id="10_w48qg"]
|
[ext_resource type="PackedScene" uid="uid://cqn67nwyrtq3k" path="res://ui/journal/journal.tscn" id="10_w48qg"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cpe4s6vsn0ujd" path="res://enemies/boss/boss.tscn" id="11_efxa6"]
|
[ext_resource type="PackedScene" uid="uid://cpe4s6vsn0ujd" path="res://enemies/boss/boss.tscn" id="11_efxa6"]
|
||||||
|
[ext_resource type="Script" uid="uid://gul4u5tw1vxk" path="res://bg_image.gd" id="13_vivmo"]
|
||||||
|
|
||||||
[node name="main" type="Node2D"]
|
[node name="main" type="Node2D"]
|
||||||
|
|
||||||
|
|
@ -87,6 +88,8 @@ anchor_bottom = 1.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
texture = ExtResource("3_kek77")
|
texture = ExtResource("3_kek77")
|
||||||
|
script = ExtResource("13_vivmo")
|
||||||
|
colors = Array[Color]([Color(0, 0.6441987, 0.6693053, 1), Color(0.90588236, 0.15686275, 0.21176471, 0.60784316), Color(0.69803923, 0.69803923, 0.69803923, 1)])
|
||||||
|
|
||||||
[node name="BossSpawner" type="Node" parent="."]
|
[node name="BossSpawner" type="Node" parent="."]
|
||||||
script = ExtResource("10_efxa6")
|
script = ExtResource("10_efxa6")
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ var current_hp = 5:
|
||||||
set(new_hp):
|
set(new_hp):
|
||||||
current_hp = new_hp
|
current_hp = new_hp
|
||||||
health_changed.emit(current_hp)
|
health_changed.emit(current_hp)
|
||||||
var max_hp = 5:
|
@export var max_hp = 5:
|
||||||
set(new_max_hp):
|
set(new_max_hp):
|
||||||
max_hp = new_max_hp
|
max_hp = new_max_hp
|
||||||
max_hp_changed.emit(max_hp)
|
max_hp_changed.emit(max_hp)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ func swing(dir_str) -> void:
|
||||||
scale.y = abs(scale.y)
|
scale.y = abs(scale.y)
|
||||||
rotation = 0
|
rotation = 0
|
||||||
anim_sprite.visible = true
|
anim_sprite.visible = true
|
||||||
await get_tree().create_timer(0.01).timeout
|
await get_tree().physics_frame
|
||||||
|
await get_tree().physics_frame
|
||||||
slash_timer = slash_duration
|
slash_timer = slash_duration
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue