backdrop build

This commit is contained in:
Page Asgardius 2024-03-17 11:20:27 -07:00
parent 396fdfe1b9
commit 3fed02c051
7 changed files with 228 additions and 9 deletions

View file

@ -12,6 +12,9 @@ const npcnames = ["Lily", null, null, null, null, null, null, null, null, "Natas
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 basestats = [[100, 100, 2, 2, 100, 2, 500], [null], [null], [null], [null], [null], [null], [null], [null], [100, 100, 2, 2, 100, 2, 500]]
var cstats = [[100, 100, null, null, 100, null, null], [null], [null], [null], [null], [null], [null], [null], [null], [100, 100, null, null, 100, null, null]]
var dstats = [[100, 100, null, null, 100, null, null], [null], [null], [null], [null], [null], [null], [null], [null], [100, 100, null, null, 100, null, null]]
var cdialog = []
const places = [[[[null, null, false], [null, null, false]], [["res://levels/Testrooms/bullethell.tscn", 11, true], ["res://levels/Testrooms/lilytest.tscn", 6, false]], [["res://levels/Testrooms/dialogtest.tscn", 19, false], ["res://levels/Testrooms/testspawn.tscn", 2 ,false]]]]
var cplace = [0,2,1]
@ -35,7 +38,7 @@ var firstrun
const musictracks = ["res://music/midorinoakuma.wav", "res://music/seahorse.wav", "res://music/chinesegoat.wav", "res://music/doyoufeelold.wav", "res://music/doyiuneedahealer.wav", "res://music/adayatceres.wav", "res://music/twintroublemakers.wav", "res://music/easyquiz.wav", "res://music/neowave.wav", "res://music/multivectorsubmarines.wav", "res://music/halfgeniegirls.wav", "res://music/rusianmaverickfairy.wav", "res://music/blacksmithofdestruction.wav", "res://music/shininglikefireworks.wav", "res://music/sadtrashcan.wav", "res://music/akikoletter.wav", "res://music/asadcat.wav", "res://music/lilydesire.wav", "res://music/scholartrip.wav", "res://music/quantumice.wav", "res://music/unreeeal.wav"]
const sfxtracks = ["res://sfx/braindamage.wav", "res://sfx/gaugefill.wav", "res://sfx/boomboombakudan.wav"]
var debug = false
const release = "R0.1.3-alpha"
const release = "R0.1.4-alpha"
var sk = false
var xm = 0
var ym = 0

View file

@ -58,6 +58,7 @@ func _on_results_pressed():
func _on_disclaimer_pressed():
Global.debug = false
get_tree().change_scene_to_file("res://backgounds/disclaimer.tscn")

View file

@ -10,7 +10,7 @@ func _process(delta):
func _level():
# This is like autoloading the scene, only
# it happens after already loading the main scene.
get_tree().change_scene_to_file("res://backgounds/disclaimer.tscn")
get_tree().change_scene_to_file("res://backgounds/wip.tscn")
#Global.live = 1
#Global.gamelevel = randi() % 3
#if Global.gamelevel == 0:

View file

@ -17,6 +17,36 @@ var focus3
var focus4
var topmini
var topminibg
var chealthf
var cstaminaf
var cskillf
var chealth1
var cstamina1
var cskill1
var chealth2
var cstamina2
var cskill2
var chealth3
var cstamina3
var cskill3
var chealth4
var cstamina4
var cskill4
var bhealthf
var bstaminaf
var bskillf
var bhealth1
var bstamina1
var bskill1
var bhealth2
var bstamina2
var bskill2
var bhealth3
var bstamina3
var bskill3
var bhealth4
var bstamina4
var bskill4
# Called when the node enters the scene tree for the first time.
func _ready():
@ -38,6 +68,36 @@ func _ready():
focus4 = $CanvasLayer/Topleft/Character4/ColorRect2
cnf = $CanvasLayer/Topmini/VBoxContainer/HBoxContainer/Label
cff = $CanvasLayer/Topmini/TextureRect
chealthf = $CanvasLayer/Topmini/VBoxContainer/HBoxContainer2/Label2
cstaminaf = $CanvasLayer/Topmini/VBoxContainer/HBoxContainer3/Label2
cskillf = $CanvasLayer/Topmini/VBoxContainer/HBoxContainer4/Label2
chealth1 = $CanvasLayer/Topleft/Character1/VBoxContainer/HBoxContainer2/Label2
cstamina1 = $CanvasLayer/Topleft/Character1/VBoxContainer/HBoxContainer3/Label2
cskill1 = $CanvasLayer/Topleft/Character1/VBoxContainer/HBoxContainer4/Label2
chealth2 = $CanvasLayer/Topleft/Character2/VBoxContainer/HBoxContainer2/Label2
cstamina2 = $CanvasLayer/Topleft/Character2/VBoxContainer/HBoxContainer3/Label2
cskill2 = $CanvasLayer/Topleft/Character2/VBoxContainer/HBoxContainer4/Label2
chealth3 = $CanvasLayer/Topleft/Character3/VBoxContainer/HBoxContainer2/Label2
cstamina3 = $CanvasLayer/Topleft/Character3/VBoxContainer/HBoxContainer3/Label2
cskill3 = $CanvasLayer/Topleft/Character3/VBoxContainer/HBoxContainer4/Label2
chealth4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer2/Label2
cstamina4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer3/Label2
cskill4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer4/Label2
bhealthf = $CanvasLayer/Topmini/VBoxContainer/HBoxContainer2/ProgressBar
bstaminaf = $CanvasLayer/Topmini/VBoxContainer/HBoxContainer3/ProgressBar
bskillf = $CanvasLayer/Topmini/VBoxContainer/HBoxContainer4/ProgressBar
bhealth1 = $CanvasLayer/Topleft/Character1/VBoxContainer/HBoxContainer2/ProgressBar
bstamina1 = $CanvasLayer/Topleft/Character1/VBoxContainer/HBoxContainer3/ProgressBar
bskill1 = $CanvasLayer/Topleft/Character1/VBoxContainer/HBoxContainer4/ProgressBar
bhealth2 = $CanvasLayer/Topleft/Character2/VBoxContainer/HBoxContainer2/ProgressBar
bstamina2 = $CanvasLayer/Topleft/Character2/VBoxContainer/HBoxContainer3/ProgressBar
bskill2 = $CanvasLayer/Topleft/Character2/VBoxContainer/HBoxContainer4/ProgressBar
bhealth3 = $CanvasLayer/Topleft/Character3/VBoxContainer/HBoxContainer2/ProgressBar
bstamina3 = $CanvasLayer/Topleft/Character3/VBoxContainer/HBoxContainer3/ProgressBar
bskill3 = $CanvasLayer/Topleft/Character3/VBoxContainer/HBoxContainer4/ProgressBar
bhealth4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer2/ProgressBar
bstamina4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer3/ProgressBar
bskill4 = $CanvasLayer/Topleft/Character4/VBoxContainer/HBoxContainer4/ProgressBar
topleft.visible = false
topleftbg.visible = false
if Global.mangohud:
@ -49,13 +109,27 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
if Global.debug:
chealthf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][0])+"/"+str(Global.basestats[Global.dparty[Global.dcpchar][0]][0]))
cstaminaf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][1])+"/"+str(Global.basestats[Global.dparty[Global.dcpchar][0]][1]))
cskillf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][4])+"/"+str(Global.basestats[Global.dparty[Global.dcpchar][0]][4]))
bhealthf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][0] * 100) / Global.basestats[Global.dparty[Global.dcpchar][0]][0]
bstaminaf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][1] * 100) / Global.basestats[Global.dparty[Global.dcpchar][0]][1]
bskillf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][4] * 100) / Global.basestats[Global.dparty[Global.dcpchar][0]][4]
else:
chealthf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][0])+"/"+str(Global.basestats[Global.dparty[Global.cpchar][0]][0]))
cstaminaf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][1])+"/"+str(Global.basestats[Global.dparty[Global.cpchar][0]][1]))
cskillf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][4])+"/"+str(Global.basestats[Global.dparty[Global.cpchar][0]][4]))
bhealthf.value = (Global.cstats[Global.party[Global.cpchar][0]][0] * 100) / Global.basestats[Global.party[Global.cpchar][0]][0]
bstaminaf.value = (Global.cstats[Global.party[Global.cpchar][0]][1] * 100) / Global.basestats[Global.party[Global.cpchar][0]][1]
bskillf.value = (Global.cstats[Global.party[Global.cpchar][0]][4] * 100) / Global.basestats[Global.party[Global.cpchar][0]][4]
func _input(event):
if Input.is_key_pressed(KEY_V) || Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER):
if Input.is_action_just_pressed("schar"):
topleft.visible = true
topleftbg.visible = true
else:
elif Input.is_action_just_released("schar"):
topleft.visible = false
topleftbg.visible = false
_charrefresh()
@ -65,6 +139,12 @@ func _charrefresh():
if Global.dparty[0][0] != null:
cn1.set_text(Global.pcnames[Global.dparty[0][0]])
cf1.texture = load(Global.hudfaces[Global.dparty[0][0]][Global.dparty[0][1]])
chealth1.set_text(str(Global.cstats[Global.dparty[0][0]][0])+"/"+str(Global.basestats[Global.dparty[0][0]][0]))
cstamina1.set_text(str(Global.cstats[Global.dparty[0][0]][1])+"/"+str(Global.basestats[Global.dparty[0][0]][1]))
cskill1.set_text(str(Global.cstats[Global.dparty[0][0]][4])+"/"+str(Global.basestats[Global.dparty[0][0]][4]))
bhealth1.value = (Global.cstats[Global.dparty[0][0]][0] * 100) / Global.basestats[Global.dparty[0][0]][0]
bstamina1.value = (Global.cstats[Global.dparty[0][0]][1] * 100) / Global.basestats[Global.dparty[0][0]][1]
bskill1.value = (Global.cstats[Global.dparty[0][0]][4] * 100) / Global.basestats[Global.dparty[0][0]][4]
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
@ -73,9 +153,21 @@ func _charrefresh():
cn1.set_text("")
cf1.texture = null
focus1.set_color(Color(1, 1, 1, 1))
chealth1.set_text("0/0")
cstamina1.set_text("0/0")
cskill1.set_text("0/0")
bhealth1.value = 0
bstamina1.value = 0
bskill1.value = 0
if Global.dparty[1][0] != null:
cn2.set_text(Global.pcnames[Global.dparty[1][0]])
cf2.texture = load(Global.hudfaces[Global.dparty[1][0]][Global.dparty[1][1]])
chealth2.set_text(str(Global.cstats[Global.dparty[1][0]][0])+"/"+str(Global.basestats[Global.dparty[1][0]][0]))
cstamina2.set_text(str(Global.cstats[Global.dparty[1][0]][1])+"/"+str(Global.basestats[Global.dparty[1][0]][1]))
cskill2.set_text(str(Global.cstats[Global.dparty[1][0]][4])+"/"+str(Global.basestats[Global.dparty[1][0]][4]))
bhealth2.value = (Global.cstats[Global.dparty[1][0]][0] * 100) / Global.basestats[Global.dparty[1][0]][0]
bstamina2.value = (Global.cstats[Global.dparty[1][0]][1] * 100) / Global.basestats[Global.dparty[1][0]][1]
bskill2.value = (Global.cstats[Global.dparty[1][0]][4] * 100) / Global.basestats[Global.dparty[1][0]][4]
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
@ -84,9 +176,21 @@ func _charrefresh():
cn2.set_text("")
cf2.texture = null
focus2.set_color(Color(1, 1, 1, 1))
chealth2.set_text("0/0")
cstamina2.set_text("0/0")
cskill2.set_text("0/0")
bhealth2.value = 0
bstamina2.value = 0
bskill2.value = 0
if Global.dparty[2][0] != null:
cn3.set_text(Global.pcnames[Global.dparty[2][0]])
cf3.texture = load(Global.hudfaces[Global.dparty[2][0]][Global.dparty[2][1]])
chealth3.set_text(str(Global.cstats[Global.dparty[2][0]][0])+"/"+str(Global.basestats[Global.dparty[2][0]][0]))
cstamina3.set_text(str(Global.cstats[Global.dparty[2][0]][1])+"/"+str(Global.basestats[Global.dparty[2][0]][1]))
cskill3.set_text(str(Global.cstats[Global.dparty[2][0]][4])+"/"+str(Global.basestats[Global.dparty[2][0]][4]))
bhealth3.value = (Global.cstats[Global.dparty[2][0]][0] * 100) / Global.basestats[Global.dparty[2][0]][0]
bstamina3.value = (Global.cstats[Global.dparty[2][0]][1] * 100) / Global.basestats[Global.dparty[2][0]][1]
bskill3.value = (Global.cstats[Global.dparty[2][0]][4] * 100) / Global.basestats[Global.dparty[2][0]][4]
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
@ -95,9 +199,21 @@ func _charrefresh():
cn3.set_text("")
cf3.texture = null
focus3.set_color(Color(1, 1, 1, 1))
chealth3.set_text("0/0")
cstamina3.set_text("0/0")
cskill3.set_text("0/0")
bhealth3.value = 0
bstamina3.value = 0
bskill3.value = 0
if Global.dparty[3][0] != null:
cn4.set_text(Global.pcnames[Global.dparty[3][0]])
cf4.texture = load(Global.hudfaces[Global.dparty[3][0]][Global.dparty[3][1]])
chealth4.set_text(str(Global.cstats[Global.dparty[3][0]][0])+"/"+str(Global.basestats[Global.dparty[3][0]][0]))
cstamina4.set_text(str(Global.cstats[Global.dparty[3][0]][1])+"/"+str(Global.basestats[Global.dparty[3][0]][1]))
cskill4.set_text(str(Global.cstats[Global.dparty[3][0]][4])+"/"+str(Global.basestats[Global.dparty[3][0]][4]))
bhealth4.value = (Global.cstats[Global.dparty[3][0]][0] * 100) / Global.basestats[Global.dparty[3][0]][0]
bstamina4.value = (Global.cstats[Global.dparty[3][0]][1] * 100) / Global.basestats[Global.dparty[3][0]][1]
bskill4.value = (Global.cstats[Global.dparty[3][0]][4] * 100) / Global.basestats[Global.dparty[3][0]][4]
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
@ -106,10 +222,22 @@ func _charrefresh():
cn4.set_text("")
cf4.texture = null
focus4.set_color(Color(1, 1, 1, 1))
chealth4.set_text("0/0")
cstamina4.set_text("0/0")
cskill4.set_text("0/0")
bhealth4.value = 0
bstamina4.value = 0
bskill4.value = 0
else:
if Global.party[0][0] != null:
cn1.set_text(Global.pcnames[Global.party[0][0]])
cf1.texture = load(Global.hudfaces[Global.party[0][0]][Global.party[0][1]])
chealth1.set_text(str(Global.cstats[Global.party[0][0]][0])+"/"+str(Global.basestats[Global.party[0][0]][0]))
cstamina1.set_text(str(Global.cstats[Global.party[0][0]][1])+"/"+str(Global.basestats[Global.party[0][0]][1]))
cskill1.set_text(str(Global.cstats[Global.party[0][0]][4])+"/"+str(Global.basestats[Global.party[0][0]][4]))
bhealth1.value = (Global.cstats[Global.party[0][0]][0] * 100) / Global.basestats[Global.party[0][0]][0]
bstamina1.value = (Global.cstats[Global.party[0][0]][1] * 100) / Global.basestats[Global.party[0][0]][1]
bskill1.value = (Global.cstats[Global.party[0][0]][4] * 100) / Global.basestats[Global.party[0][0]][4]
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
@ -117,10 +245,22 @@ func _charrefresh():
else:
cn1.set_text("")
cf1.texture = null
chealth1.set_text("0/0")
cstamina1.set_text("0/0")
cskill1.set_text("0/0")
bhealth1.value = 0
bstamina1.value = 0
bskill1.value = 0
focus1.set_color(Color(1, 1, 1, 1))
if Global.party[1][0] != null:
cn2.set_text(Global.pcnames[Global.party[1][0]])
cf2.texture = load(Global.hudfaces[Global.party[1][0]][Global.party[1][1]])
chealth2.set_text(str(Global.cstats[Global.party[1][0]][0])+"/"+str(Global.basestats[Global.party[1][0]][0]))
cstamina2.set_text(str(Global.cstats[Global.party[1][0]][1])+"/"+str(Global.basestats[Global.party[1][0]][1]))
cskill2.set_text(str(Global.cstats[Global.party[1][0]][4])+"/"+str(Global.basestats[Global.party[1][0]][4]))
bhealth2.value = (Global.cstats[Global.party[1][0]][0] * 100) / Global.basestats[Global.party[1][0]][0]
bstamina2.value = (Global.cstats[Global.party[1][0]][1] * 100) / Global.basestats[Global.party[1][0]][1]
bskill2.value = (Global.cstats[Global.party[1][0]][4] * 100) / Global.basestats[Global.party[1][0]][4]
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
@ -128,10 +268,22 @@ func _charrefresh():
else:
cn2.set_text("")
cf2.texture = null
chealth2.set_text("0/0")
cstamina2.set_text("0/0")
cskill2.set_text("0/0")
bhealth2.value = 0
bstamina2.value = 0
bskill2.value = 0
focus2.set_color(Color(1, 1, 1, 1))
if Global.party[2][0] != null:
cn3.set_text(Global.pcnames[Global.party[2][0]])
cf3.texture = load(Global.hudfaces[Global.party[2][0]][Global.party[2][1]])
chealth3.set_text(str(Global.cstats[Global.party[2][0]][0])+"/"+str(Global.basestats[Global.party[2][0]][0]))
cstamina3.set_text(str(Global.cstats[Global.party[2][0]][1])+"/"+str(Global.basestats[Global.party[2][0]][1]))
cskill3.set_text(str(Global.cstats[Global.party[2][0]][4])+"/"+str(Global.basestats[Global.party[2][0]][4]))
bhealth3.value = (Global.cstats[Global.party[2][0]][0] * 100) / Global.basestats[Global.party[2][0]][0]
bstamina3.value = (Global.cstats[Global.party[2][0]][1] * 100) / Global.basestats[Global.party[2][0]][1]
bskill3.value = (Global.cstats[Global.party[2][0]][4] * 100) / Global.basestats[Global.party[2][0]][4]
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
@ -139,10 +291,22 @@ func _charrefresh():
else:
cn3.set_text("")
cf3.texture = null
chealth3.set_text("0/0")
cstamina3.set_text("0/0")
cskill3.set_text("0/0")
bhealth3.value = 0
bstamina3.value = 0
bskill3.value = 0
focus3.set_color(Color(1, 1, 1, 1))
if Global.party[3][0] != null:
cn4.set_text(Global.pcnames[Global.party[3][0]])
cf4.texture = load(Global.hudfaces[Global.party[3][0]][Global.party[3][1]])
chealth4.set_text(str(Global.cstats[Global.party[3][0]][0])+"/"+str(Global.basestats[Global.party[3][0]][0]))
cstamina4.set_text(str(Global.cstats[Global.party[3][0]][1])+"/"+str(Global.basestats[Global.party[3][0]][1]))
cskill4.set_text(str(Global.cstats[Global.party[3][0]][4])+"/"+str(Global.basestats[Global.party[3][0]][4]))
bhealth4.value = (Global.cstats[Global.party[3][0]][0] * 100) / Global.basestats[Global.party[3][0]][0]
bstamina4.value = (Global.cstats[Global.party[3][0]][1] * 100) / Global.basestats[Global.party[3][0]][1]
bskill4.value = (Global.cstats[Global.party[3][0]][4] * 100) / Global.basestats[Global.party[3][0]][4]
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
@ -150,12 +314,30 @@ func _charrefresh():
else:
cn4.set_text("")
cf4.texture = null
chealth4.set_text("0/0")
cstamina4.set_text("0/0")
cskill4.set_text("0/0")
bhealth4.value = 0
bstamina4.value = 0
bskill4.value = 0
focus4.set_color(Color(1, 1, 1, 1))
else:
if Global.debug:
cnf.set_text(Global.pcnames[Global.dparty[Global.dcpchar][0]])
cff.texture = load(Global.hudfaces[Global.dparty[Global.dcpchar][0]][Global.dparty[Global.dcpchar][1]])
chealthf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][0])+"/"+str(Global.basestats[Global.dparty[Global.dcpchar][0]][0]))
cstaminaf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][1])+"/"+str(Global.basestats[Global.dparty[Global.dcpchar][0]][1]))
cskillf.set_text(str(Global.cstats[Global.dparty[Global.dcpchar][0]][4])+"/"+str(Global.basestats[Global.dparty[Global.dcpchar][0]][4]))
bhealthf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][0] * 100) / Global.basestats[Global.dparty[Global.dcpchar][0]][0]
bstaminaf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][1] * 100) / Global.basestats[Global.dparty[Global.dcpchar][0]][1]
bskillf.value = (Global.cstats[Global.dparty[Global.dcpchar][0]][4] * 100) / Global.basestats[Global.dparty[Global.dcpchar][0]][4]
else:
cnf.set_text(Global.pcnames[Global.party[Global.cpchar][0]])
cff.texture = load(Global.hudfaces[Global.party[Global.cpchar][0]][Global.party[Global.cpchar][1]])
chealthf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][0])+"/"+str(Global.basestats[Global.dparty[Global.cpchar][0]][0]))
cstaminaf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][1])+"/"+str(Global.basestats[Global.dparty[Global.cpchar][0]][1]))
cskillf.set_text(str(Global.cstats[Global.dparty[Global.cpchar][0]][4])+"/"+str(Global.basestats[Global.dparty[Global.cpchar][0]][4]))
bhealthf.value = (Global.cstats[Global.party[Global.cpchar][0]][0] * 100) / Global.basestats[Global.party[Global.cpchar][0]][0]
bstaminaf.value = (Global.cstats[Global.party[Global.cpchar][0]][1] * 100) / Global.basestats[Global.party[Global.cpchar][0]][1]
bskillf.value = (Global.cstats[Global.party[Global.cpchar][0]][4] * 100) / Global.basestats[Global.party[Global.cpchar][0]][4]

View file

@ -54,6 +54,12 @@ stopmusic={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
]
}
schar={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":86,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null)
]
}
[physics]

View file

@ -6,6 +6,7 @@ const JUMP_VELOCITY = -400.0
var angle = 2
var sprite
var anim
var speed
var csprite
var bpress = false
# Get the gravity from the project settings to be synced with RigidBody nodes.
@ -16,13 +17,14 @@ func _ready():
add_to_group("players")
anim = $AnimationPlayer
sprite = $Sprite2D
_charswitch()
#_charswitch()
_charinit()
func _physics_process(delta):
# Add the gravity.
#var velocity = Vector2.ZERO
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) * speed * Global.xm * delta)-Vector2.UP.rotated(rotation) * speed * Global.ym * delta
#origmpos = get_viewport().get_mouse_position()
#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)
@ -57,6 +59,7 @@ func _physics_process(delta):
func _input(event):
if Global.live == 1:
if Input.is_action_pressed("schar"):
_charswitch()
if Input.is_action_just_pressed("shoot") && !bpress && Global.live == 1:
bpress = true
@ -67,7 +70,7 @@ func _input(event):
bullet = load(Global.pbbullets[Global.party[Global.cpchar][0]])
var new_pbullet = bullet.instantiate()
new_pbullet.btype = "players"
new_pbullet.velocity = Vector2(0, -500).rotated(deg_to_rad(angle * 90))
new_pbullet.velocity = Vector2(0, -speed).rotated(deg_to_rad(angle * 90))
var rposition = Vector2(0, -96).rotated(deg_to_rad(angle * 90))
if angle == 2:
new_pbullet.position = Vector2(position.x + rposition.x, position.y + rposition.y + 98)
@ -78,13 +81,36 @@ func _input(event):
elif Input.is_action_just_released("shoot") && bpress:
bpress = false
func _charinit():
if Global.debug:
speed = Global.basestats[Global.dparty[Global.dcpchar][0]][6]
#print(Global.dparty[Global.dcpchar][0])
#print(speed)
else:
speed = Global.basestats[Global.party[Global.cpchar][0]][6]
#print(Global.dparty[Global.cpchar][0])
#print(speed)
_charswitch()
func _charswitch():
if Global.debug:
if csprite != null && speed!=Global.basestats[Global.dparty[csprite][0]][6]:
print("Script Kiddie")
speed = Global.dparty/800
else:
speed = Global.basestats[Global.dparty[Global.dcpchar][0]][6]
if Global.dcpchar != csprite:
csprite = Global.dcpchar
sprite.texture = load(Global.pchars[Global.dparty[Global.dcpchar][0]][Global.dparty[Global.dcpchar][1]])
weakness = Global.specialities[Global.pcspecialities[Global.dparty[Global.dcpchar][0]]]
print(Global.dparty[Global.dcpchar][0])
print(speed)
else:
if csprite != null && speed!=Global.basestats[Global.party[Global.cpchar][0]][6]:
print("Script Kiddie")
speed = Global.party/800
else:
speed = Global.basestats[Global.party[Global.dcpchar][0]][6]
if Global.cpchar != csprite:
csprite = Global.cpchar
sprite.texture = load(Global.pchars[Global.party[Global.cpchar][0]][Global.party[Global.cpchar][1]])

View file

@ -171,6 +171,7 @@ vframes = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 94)
shape = SubResource("RectangleShape2D_dj8gt")
debug_color = Color(0, 1, 0, 1)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {