tophud (wip)

This commit is contained in:
Page Asgardius 2024-01-29 20:05:17 -07:00
parent c7c89f5414
commit 6b5f8dd609
19 changed files with 737 additions and 24 deletions

View file

@ -10,15 +10,18 @@ var bossready = false
const pcnames = ["Midori Asgardius", null, null, null, null, null, null, null, null, "Natasha Dostoyevsky"] const pcnames = ["Midori Asgardius", null, null, null, null, null, null, null, null, "Natasha Dostoyevsky"]
const npcnames = ["Lily", null, null, null, null, null, null, null, null, "Natasha Dostoyevsky"] const npcnames = ["Lily", null, null, null, null, null, null, null, null, "Natasha Dostoyevsky"]
const pcfaces = ["res://sprites/common/midori/face.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/face.png"] const pcfaces = ["res://sprites/common/midori/face.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/face.png"]
const hudfaces = ["res://sprites/common/midori/facehud.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/facehud.png"]
const npcfaces = ["res://sprites/common/midori/face.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/face.png"] const npcfaces = ["res://sprites/common/midori/face.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/face.png"]
var cdialog = [] var cdialog = []
const places = [[[[null, null, false], [null, null, false]], [["res://levels/Testrooms/bullethell.tscn", 11, true], ["res://levels/Testrooms/lilytest.tscn", 20, true]], [["res://levels/Testrooms/dialogtest.tscn", 19, false], ["res://levels/Testrooms/testspawn.tscn", 2 ,false]]]] const places = [[[[null, null, false], [null, null, false]], [["res://levels/Testrooms/bullethell.tscn", 11, true], ["res://levels/Testrooms/lilytest.tscn", 20, true]], [["res://levels/Testrooms/dialogtest.tscn", 19, false], ["res://levels/Testrooms/testspawn.tscn", 2 ,false]]]]
var cplace = [0,2,1] var cplace = [0,2,1]
var dplace = [null, null, null] var dplace = [null, null, null]
const pbbullets = ["res://sprites/common/bullet/fireball.tscn", null, null, null, null, null, null, null, null, "res://sprites/common/bullet/fireball.tscn"] const pbbullets = ["res://sprites/common/bullet/fireball.tscn", null, null, null, null, null, null, null, null, "res://sprites/common/bullet/snowflake.tscn"]
const pcspecialities = [1, null, null, null, null, null, null, null, null, 0]
const pchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"] const pchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"]
const npchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"] const npchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"]
var party = [null, null, null, null] var party = [9, 0, null, null]
const specialities = [2, 0, 3, 1, 5, 4]
var dparty = [0, 9, null, null] var dparty = [0, 9, null, null]
var cpchar = 0 var cpchar = 0
var dcpchar = 0 var dcpchar = 0

View file

@ -0,0 +1,12 @@
extends Node2D
var boss
# Called when the node enters the scene tree for the first time.
func _ready():
boss = $Lily
boss.add_to_group("boss")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

View file

@ -1,5 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://cma7ddp0r4rm"] [gd_scene load_steps=7 format=3 uid="uid://cma7ddp0r4rm"]
[ext_resource type="Script" path="res://levels/Testrooms/lilytest.gd" id="1_b1yf3"]
[ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_bch3a"] [ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_bch3a"]
[ext_resource type="PackedScene" uid="uid://b216q83uw4c45" path="res://sprites/common/midori/lily.tscn" id="2_v1fc7"] [ext_resource type="PackedScene" uid="uid://b216q83uw4c45" path="res://sprites/common/midori/lily.tscn" id="2_v1fc7"]
[ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_h02gt"] [ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_h02gt"]
@ -11,6 +12,7 @@ size = Vector2(20, 761)
size = Vector2(1283, 20) size = Vector2(1283, 20)
[node name="Lilytest" type="Node2D"] [node name="Lilytest" type="Node2D"]
script = ExtResource("1_b1yf3")
[node name="TextureRect" type="TextureRect" parent="."] [node name="TextureRect" type="TextureRect" parent="."]
offset_left = 583.0 offset_left = 583.0

View file

@ -7,6 +7,8 @@ var sfx1 := AudioStreamPlayer.new()
var musictrack var musictrack
var isboss var isboss
var bhud = load("res://levels/bottomhud.tscn").instantiate() var bhud = load("res://levels/bottomhud.tscn").instantiate()
var thud = load("res://levels/ui/tophud.tscn").instantiate()
var ishud = true
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
@ -34,6 +36,7 @@ func _ready():
music = load(musictrack) music = load(musictrack)
get_tree().root.add_child.call_deferred(level) get_tree().root.add_child.call_deferred(level)
get_tree().root.add_child.call_deferred(bhud) get_tree().root.add_child.call_deferred(bhud)
get_tree().root.add_child.call_deferred(thud)
#get_tree().root.add_child.call_deferred(player) #get_tree().root.add_child.call_deferred(player)
bgsound.stream = music bgsound.stream = music
if !isboss: if !isboss:
@ -65,6 +68,7 @@ func _input(event):
if Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK): if Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK):
Global.live = 0 Global.live = 0
Global.bossready = false Global.bossready = false
get_tree().root.remove_child(thud)
get_tree().root.remove_child(bhud) get_tree().root.remove_child(bhud)
get_tree().root.remove_child(player) get_tree().root.remove_child(player)
get_tree().root.remove_child(level) get_tree().root.remove_child(level)
@ -72,28 +76,28 @@ func _input(event):
get_tree().change_scene_to_file("res://levels/ui/scene.tscn") get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
else: else:
get_tree().change_scene_to_file("res://title.tscn") get_tree().change_scene_to_file("res://title.tscn")
if (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_UP)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP)): if (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_UP)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP))):
if Global.debug: if Global.debug:
if Global.dparty[0] != null: if Global.dparty[0] != null:
Global.dcpchar = 0 Global.dcpchar = 0
else: else:
if Global.party[0] != null: if Global.party[0] != null:
Global.cpchar = 0 Global.cpchar = 0
elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT)): elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT))):
if Global.debug: if Global.debug:
if Global.dparty[1] != null: if Global.dparty[1] != null:
Global.dcpchar = 1 Global.dcpchar = 1
else: else:
if Global.party[1] != null: if Global.party[1] != null:
Global.cpchar = 1 Global.cpchar = 1
elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN)): elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN))):
if Global.debug: if Global.debug:
if Global.dparty[2] != null: if Global.dparty[2] != null:
Global.dcpchar = 2 Global.dcpchar = 2
else: else:
if Global.party[2] != null: if Global.party[2] != null:
Global.cpchar = 2 Global.cpchar = 2
elif (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT)): elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT))):
if Global.debug: if Global.debug:
if Global.dparty[3] != null: if Global.dparty[3] != null:
Global.dcpchar = 3 Global.dcpchar = 3
@ -105,3 +109,9 @@ func _input(event):
sfx1.stream = load(Global.sfxtracks[1]) sfx1.stream = load(Global.sfxtracks[1])
sfx1.play(0) sfx1.play(0)
bgsound.play(0) bgsound.play(0)
if Global.cdialog.size() != 0 && ishud:
get_tree().root.remove_child(thud)
ishud = false
elif Global.cdialog.size() == 0&& !ishud:
get_tree().root.add_child.call_deferred(thud)
ishud = true

View file

@ -12,10 +12,10 @@ func _ready():
pface = $Playerface pface = $Playerface
if Global.cdialog[dindex][1]: if Global.cdialog[dindex][1]:
cname.set_text(Global.pcnames[Global.cdialog[dindex][2]]) cname.set_text(Global.pcnames[Global.cdialog[dindex][2]])
pface.texture = load((Global.pcfaces[Global.cdialog[dindex][2]])) pface.texture = load(Global.pcfaces[Global.cdialog[dindex][2]])
else: else:
cname.set_text(Global.npcnames[Global.cdialog[dindex][2]]) cname.set_text(Global.npcnames[Global.cdialog[dindex][2]])
pface.texture = load((Global.npcfaces[Global.cdialog[dindex][2]])) pface.texture = load(Global.npcfaces[Global.cdialog[dindex][2]])
dialog.set_text(Global.cdialog[dindex][0]) dialog.set_text(Global.cdialog[dindex][0])

134
levels/ui/tophud.gd Normal file
View file

@ -0,0 +1,134 @@
extends Control
var topleft
var topleftbg
var cn1
var cn2
var cn3
var cn4
var cf1
var cf2
var cf3
var cf4
var focus1
var focus2
var focus3
var focus4
# Called when the node enters the scene tree for the first time.
func _ready():
topleft = $Topleft
topleftbg = $Topleftbg
cn1 = $Topleft/Character1/VBoxContainer/HBoxContainer/Label
cn2 = $Topleft/Character2/VBoxContainer/HBoxContainer/Label
cn3 = $Topleft/Character3/VBoxContainer/HBoxContainer/Label
cn4 = $Topleft/Character4/VBoxContainer/HBoxContainer/Label
cf1 = $Topleft/Character1/TextureRect
cf2 = $Topleft/Character2/TextureRect
cf3 = $Topleft/Character3/TextureRect
cf4 = $Topleft/Character4/TextureRect
focus1 = $Topleft/Character1/ColorRect2
focus2 = $Topleft/Character2/ColorRect2
focus3 = $Topleft/Character3/ColorRect2
focus4 = $Topleft/Character4/ColorRect2
if Global.mangohud:
topleft.position.y = 244
topleftbg.position.y = 244
_charrefresh()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _input(event):
_charrefresh()
func _charrefresh():
if Global.debug:
if Global.dparty[0] != null:
cn1.set_text(Global.pcnames[Global.dparty[0]])
cf1.texture = load(Global.hudfaces[Global.dparty[0]])
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
focus1.set_color(Color(1, 1, 1, 1))
else:
cn1.set_text("")
cf1.texture = null
focus1.set_color(Color(1, 1, 1, 1))
if Global.dparty[1] != null:
cn2.set_text(Global.pcnames[Global.dparty[1]])
cf2.texture = load(Global.hudfaces[Global.dparty[1]])
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
focus2.set_color(Color(1, 1, 1, 1))
else:
cn2.set_text("")
cf2.texture = null
focus2.set_color(Color(1, 1, 1, 1))
if Global.dparty[2] != null:
cn3.set_text(Global.pcnames[Global.dparty[2]])
cf3.texture = load(Global.hudfaces[Global.dparty[2]])
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
focus3.set_color(Color(1, 1, 1, 1))
else:
cn3.set_text("")
cf3.texture = null
focus3.set_color(Color(1, 1, 1, 1))
if Global.dparty[3] != null:
cn4.set_text(Global.pcnames[Global.dparty[3]])
cf4.texture = load(Global.hudfaces[Global.dparty[3]])
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
focus4.set_color(Color(1, 1, 1, 1))
else:
cn4.set_text("")
cf4.texture = null
focus4.set_color(Color(1, 1, 1, 1))
else:
if Global.party[0] != null:
cn1.set_text(Global.pcnames[Global.party[0]])
cf1.texture = load(Global.hudfaces[Global.party[0]])
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
focus1.set_color(Color(1, 1, 1, 1))
else:
cn1.set_text("")
cf1.texture = null
focus1.set_color(Color(1, 1, 1, 1))
if Global.party[1] != null:
cn2.set_text(Global.pcnames[Global.party[1]])
cf2.texture = load(Global.hudfaces[Global.party[1]])
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
focus2.set_color(Color(1, 1, 1, 1))
else:
cn2.set_text("")
cf2.texture = null
focus2.set_color(Color(1, 1, 1, 1))
if Global.party[2] != null:
cn3.set_text(Global.pcnames[Global.party[0]])
cf3.texture = load(Global.hudfaces[Global.party[0]])
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
focus3.set_color(Color(1, 1, 1, 1))
else:
cn3.set_text("")
cf3.texture = null
focus3.set_color(Color(1, 1, 1, 1))
if Global.party[3] != null:
cn4.set_text(Global.pcnames[Global.party[3]])
cf4.texture = load(Global.hudfaces[Global.party[3]])
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
focus4.set_color(Color(1, 1, 1, 1))
else:
cn4.set_text("")
cf4.texture = null
focus4.set_color(Color(1, 1, 1, 1))

379
levels/ui/tophud.tscn Normal file
View file

@ -0,0 +1,379 @@
[gd_scene load_steps=7 format=3 uid="uid://coaup7cuj7qev"]
[ext_resource type="Script" path="res://levels/ui/tophud.gd" id="1_pntuv"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ualpu"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_patnr"]
bg_color = Color(1, 0, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_05pau"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_u3vj7"]
bg_color = Color(1, 0.498039, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ftyws"]
[node name="Tophud" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_pntuv")
[node name="Topleftbg" type="ColorRect" parent="."]
layout_mode = 0
offset_right = 377.0
offset_bottom = 476.0
color = Color(0.254902, 0.254902, 0.254902, 0.788235)
[node name="Topleft" type="VBoxContainer" parent="."]
layout_mode = 0
offset_right = 377.0
offset_bottom = 476.0
[node name="Character1" type="HBoxContainer" parent="Topleft"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Topleft/Character1"]
custom_minimum_size = Vector2(116, 116)
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character1"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(174, 0)
layout_mode = 2
text = "Name"
[node name="Label3" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "R1 + ↑"
horizontal_alignment = 2
[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Health"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character1/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ualpu")
theme_override_styles/fill = SubResource("StyleBoxFlat_patnr")
[node name="Label2" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Stamina"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character1/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_05pau")
theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7")
[node name="Label2" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character1/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Skill"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character1/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
[node name="Label2" type="Label" parent="Topleft/Character1/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="ColorRect2" type="ColorRect" parent="Topleft/Character1"]
custom_minimum_size = Vector2(12, 64)
layout_mode = 2
[node name="Character2" type="HBoxContainer" parent="Topleft"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Topleft/Character2"]
custom_minimum_size = Vector2(116, 116)
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character2"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(174, 0)
layout_mode = 2
text = "Name"
[node name="Label3" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "R1 + →"
horizontal_alignment = 2
[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Health"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character2/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ualpu")
theme_override_styles/fill = SubResource("StyleBoxFlat_patnr")
[node name="Label2" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Stamina"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character2/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_05pau")
theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7")
[node name="Label2" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character2/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Skill"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character2/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
[node name="Label2" type="Label" parent="Topleft/Character2/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="ColorRect2" type="ColorRect" parent="Topleft/Character2"]
custom_minimum_size = Vector2(12, 64)
layout_mode = 2
[node name="Character3" type="HBoxContainer" parent="Topleft"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Topleft/Character3"]
custom_minimum_size = Vector2(116, 116)
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character3"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(174, 0)
layout_mode = 2
text = "Name"
[node name="Label3" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "R1 + ↓"
horizontal_alignment = 2
[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Health"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character3/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ualpu")
theme_override_styles/fill = SubResource("StyleBoxFlat_patnr")
[node name="Label2" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Stamina"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character3/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_05pau")
theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7")
[node name="Label2" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character3/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Skill"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character3/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
[node name="Label2" type="Label" parent="Topleft/Character3/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="ColorRect2" type="ColorRect" parent="Topleft/Character3"]
custom_minimum_size = Vector2(12, 64)
layout_mode = 2
[node name="Character4" type="HBoxContainer" parent="Topleft"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Topleft/Character4"]
custom_minimum_size = Vector2(116, 116)
layout_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Topleft/Character4"]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(174, 0)
layout_mode = 2
text = "Name"
[node name="Label3" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "R1 + ←"
horizontal_alignment = 2
[node name="HBoxContainer2" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Health"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character4/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ualpu")
theme_override_styles/fill = SubResource("StyleBoxFlat_patnr")
[node name="Label2" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer2"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer3" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Stamina"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character4/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_05pau")
theme_override_styles/fill = SubResource("StyleBoxFlat_u3vj7")
[node name="Label2" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer3"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="HBoxContainer4" type="HBoxContainer" parent="Topleft/Character4/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(70, 0)
layout_mode = 2
text = "Skill"
[node name="ProgressBar" type="ProgressBar" parent="Topleft/Character4/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_ftyws")
[node name="Label2" type="Label" parent="Topleft/Character4/VBoxContainer/HBoxContainer4"]
custom_minimum_size = Vector2(63, 0)
layout_mode = 2
text = "100/100"
horizontal_alignment = 2
[node name="ColorRect2" type="ColorRect" parent="Topleft/Character4"]
custom_minimum_size = Vector2(12, 64)
layout_mode = 2

View file

@ -22,6 +22,9 @@ func _physics_process(delta):
func _on_body_entered(body): func _on_body_entered(body):
if !body.is_in_group(btype): if !body.is_in_group(btype):
if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"):
if body.weakness == 3:
print("weak to fire")
#if body.is_in_group("players"): #if body.is_in_group("players"):
# Global.live = 2 # Global.live = 2
#elif body.is_in_group("enemies"): #elif body.is_in_group("enemies"):

View file

@ -0,0 +1,44 @@
extends Area2D
var velocity: Vector2 = Vector2()
var direction
var speed = 100
var btype
# Called when the node enters the scene tree for the first time.
func _ready():
add_to_group(btype)
#pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
if direction == null:
position += velocity * delta
else:
position += speed * delta * direction
func _on_body_entered(body):
if !body.is_in_group(btype):
if body.is_in_group("players") || body.is_in_group("boss") || body.is_in_group("enemies"):
if body.weakness == 0:
print("weak to ice")
#if body.is_in_group("players"):
# Global.live = 2
#elif body.is_in_group("enemies"):
# Global.live = 3
#elif body.is_in_group("boss"):
# Global.live = 3
queue_free()
func _on_screen_exited():
queue_free()
func _on_area_entered(area):
if !area.is_in_group(btype):
queue_free()
#pass # Replace with function body.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://nvayru3j13ts"
path="res://.godot/imported/snowflake.png-955eeb363f6816e7809a87df0c75bf64.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/common/bullet/snowflake.png"
dest_files=["res://.godot/imported/snowflake.png-955eeb363f6816e7809a87df0c75bf64.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,21 @@
[gd_scene load_steps=4 format=3 uid="uid://cexo7mwqpmw4b"]
[ext_resource type="Script" path="res://sprites/common/bullet/snowflake.gd" id="1_w4m7a"]
[ext_resource type="Texture2D" uid="uid://nvayru3j13ts" path="res://sprites/common/bullet/snowflake.png" id="2_0alhu"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_g125y"]
size = Vector2(60, 60)
[node name="Snowflake" type="Area2D"]
script = ExtResource("1_w4m7a")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_0alhu")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_g125y")
[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ckjccj40wqboe"
path="res://.godot/imported/facehud.png-853dc11b9d2eda9b4f3dbda0602e31cd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/common/midori/facehud.png"
dest_files=["res://.godot/imported/facehud.png-853dc11b9d2eda9b4f3dbda0602e31cd.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -4,6 +4,7 @@ extends CharacterBody2D
const SPEED = 300.0 const SPEED = 300.0
const JUMP_VELOCITY = -400.0 const JUMP_VELOCITY = -400.0
var angle = 2 var angle = 2
var weakness = 0
# Get the gravity from the project settings to be synced with RigidBody nodes. # Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cw2pkjwxw0mj0"
path="res://.godot/imported/facehud.png-cabef45f07551c953d7df3ee19ee1aca.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/common/natasha/facehud.png"
dest_files=["res://.godot/imported/facehud.png-cabef45f07551c953d7df3ee19ee1aca.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -2,11 +2,12 @@ extends CharacterBody2D
var theta: float = 0.0 var theta: float = 0.0
@export_range(0,2*PI) var alpha: float = 1.5 @export_range(0,2*PI) var alpha: float = 1.5
var bullet = load("res://sprites/common/bullet/fireball.tscn") var bullet = load("res://sprites/common/bullet/snowflake.tscn")
const SPEED = 300.0 const SPEED = 300.0
const JUMP_VELOCITY = -400.0 const JUMP_VELOCITY = -400.0
var vangle = 2 var vangle = 2
var weakness = 2
func get_vector(angle): func get_vector(angle):
theta = angle + alpha theta = angle + alpha

View file

@ -10,31 +10,20 @@ var csprite
var bpress = false var bpress = false
# Get the gravity from the project settings to be synced with RigidBody nodes. # Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
var weakness
func _ready(): func _ready():
add_to_group("players") add_to_group("players")
anim = $AnimationPlayer anim = $AnimationPlayer
sprite = $Sprite2D sprite = $Sprite2D
if Global.debug: _charswitch()
csprite = Global.dcpchar
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
else:
csprite = Global.cpchar
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
func _physics_process(delta): func _physics_process(delta):
# Add the gravity. # Add the gravity.
#var velocity = Vector2.ZERO #var velocity = Vector2.ZERO
if Global.live == 1: if Global.live == 1:
velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta
if Global.debug: _charswitch()
if Global.dcpchar != csprite:
csprite = Global.dcpchar
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
else:
if Global.cpchar != csprite:
csprite = Global.cpchar
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
#origmpos = get_viewport().get_mouse_position() #origmpos = get_viewport().get_mouse_position()
#if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0: #if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0:
# velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) # velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
@ -88,3 +77,15 @@ func _input(event):
get_parent().add_child(new_pbullet) get_parent().add_child(new_pbullet)
elif Input.is_action_just_released("shoot") && bpress: elif Input.is_action_just_released("shoot") && bpress:
bpress = false bpress = false
func _charswitch():
if Global.debug:
if Global.dcpchar != csprite:
csprite = Global.dcpchar
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar]])
weakness = Global.specialities[Global.pcspecialities[Global.dparty[Global.dcpchar]]]
else:
if Global.cpchar != csprite:
csprite = Global.cpchar
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
weakness = Global.specialities[Global.pcspecialities[Global.party[Global.cpchar]]]