character outfit ready

This commit is contained in:
Page Asgardius 2024-03-06 10:49:01 -07:00
parent fa68edfb24
commit fd21d0ed2d
10 changed files with 286 additions and 55 deletions

View file

@ -9,20 +9,20 @@ var wait
var bossready = false
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 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 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"]
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", 6, false]], [["res://levels/Testrooms/dialogtest.tscn", 19, false], ["res://levels/Testrooms/testspawn.tscn", 2 ,false]]]]
var cplace = [0,2,1]
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/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"]
var party = [9, 0, null, null]
var party = [[0,0], [9,0], [null,null], [null,null]]
const specialities = [2, 0, 3, 1, 5, 4]
var dparty = [0, 9, null, null]
var dparty = [[0,0], [9,0], [null,null], [null,null]]
var cpchar = 0
var dcpchar = 0
var mangohud = false

View file

@ -5,7 +5,7 @@ var boss
func _ready():
boss = $Natasha
boss.add_to_group("boss")
Global.cdialog = [["What are you doing here?", true, 0], ["Your father need help to debug this game", false, 9], ["Ok, i'll help too", true, 0]]
Global.cdialog = [["What are you doing here?", true, 0, 0], ["Your father need help to debug this game", false, 9], ["Ok, i'll help too", true, 0, 0]]
Global.live = 0
get_tree().root.add_child.call(talk)

View file

@ -2,7 +2,7 @@ extends Node2D
var talk = load("res://levels/ui/talk.tscn").instantiate()
# Called when the node enters the scene tree for the first time.
func _ready():
Global.cdialog = [["What is this place?", true, 0], ["I'm here", false, 9], ["I got you, cheap copy", false, 0]]
Global.cdialog = [["What is this place?", true, 0, 0], ["I'm here", false, 9], ["I got you, cheap copy", false, 0]]
Global.live = 0
get_tree().root.add_child.call(talk)

View file

@ -2,7 +2,7 @@
[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="PackedScene" uid="uid://b216q83uw4c45" path="res://sprites/common/midori/lily.tscn" id="2_v1fc7"]
[ext_resource type="PackedScene" uid="uid://ba1erruilgjxo" 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"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1jr1w"]

View file

@ -78,31 +78,31 @@ func _input(event):
get_tree().change_scene_to_file("res://title.tscn")
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.dparty[0] != null:
if Global.dparty[0][0] != null:
Global.dcpchar = 0
else:
if Global.party[0] != null:
if Global.party[0][0] != null:
Global.cpchar = 0
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.dparty[1] != null:
if Global.dparty[1][0] != null:
Global.dcpchar = 1
else:
if Global.party[1] != null:
if Global.party[1][0] != null:
Global.cpchar = 1
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.dparty[2] != null:
if Global.dparty[2][0] != null:
Global.dcpchar = 2
else:
if Global.party[2] != null:
if Global.party[2][0] != null:
Global.cpchar = 2
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.dparty[3] != null:
if Global.dparty[3][0] != null:
Global.dcpchar = 3
else:
if Global.party[3] != null:
if Global.party[3][0] != null:
Global.cpchar = 3
if Global.bossready:
Global.bossready = false

View file

@ -12,7 +12,7 @@ func _ready():
pface = $Playerface
if Global.cdialog[dindex][1]:
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]][Global.cdialog[dindex][3]])
else:
cname.set_text(Global.npcnames[Global.cdialog[dindex][2]])
pface.texture = load(Global.npcfaces[Global.cdialog[dindex][2]])
@ -31,7 +31,7 @@ func _input(event):
if dindex < Global.cdialog.size():
if Global.cdialog[dindex][1]:
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]][Global.cdialog[dindex][2]]))
else:
cname.set_text(Global.npcnames[Global.cdialog[dindex][2]])
pface.texture = load((Global.npcfaces[Global.cdialog[dindex][2]]))

View file

@ -62,9 +62,9 @@ func _input(event):
func _charrefresh():
if topleft.visible:
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.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]])
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
@ -73,9 +73,9 @@ func _charrefresh():
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.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]])
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
@ -84,9 +84,9 @@ func _charrefresh():
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.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]])
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
@ -95,9 +95,9 @@ func _charrefresh():
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.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]])
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
@ -107,9 +107,9 @@ func _charrefresh():
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.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]])
if Global.dcpchar == 0:
focus1.set_color(Color(0, 0, 1, 1))
else:
@ -118,9 +118,9 @@ func _charrefresh():
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.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]])
if Global.dcpchar == 1:
focus2.set_color(Color(0, 0, 1, 1))
else:
@ -129,9 +129,9 @@ func _charrefresh():
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.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]])
if Global.dcpchar == 2:
focus3.set_color(Color(0, 0, 1, 1))
else:
@ -140,9 +140,9 @@ func _charrefresh():
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.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]])
if Global.dcpchar == 3:
focus4.set_color(Color(0, 0, 1, 1))
else:
@ -153,9 +153,9 @@ func _charrefresh():
focus4.set_color(Color(1, 1, 1, 1))
else:
if Global.debug:
cnf.set_text(Global.pcnames[Global.dparty[Global.dcpchar]])
cff.texture = load(Global.hudfaces[Global.dparty[Global.dcpchar]])
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]])
else:
cnf.set_text(Global.pcnames[Global.party[Global.cpchar]])
cff.texture = load(Global.hudfaces[Global.party[Global.cpchar]])
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]])

View file

@ -0,0 +1,51 @@
extends CharacterBody2D
const SPEED = 300.0
const JUMP_VELOCITY = -400.0
var angle = 2
var weakness = 0
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
@onready var anim := $AnimationPlayer
func _physics_process(delta):
velocity.x = 0
velocity.y = 0
# 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
#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)
#position += velocity
if velocity.y > 0.3:
angle = 2
elif velocity.y < -0.3:
angle = 0
elif velocity.x > 0.3:
angle = 1
elif velocity.x < -0.3:
angle = 3
if velocity.y != 0 || velocity.x != 0:
if angle == 0:
anim.play("nwalk")
elif angle == 1:
anim.play("ewalk")
elif angle == 3:
anim.play("wwalk")
else:
anim.play("swalk")
else:
if angle == 0:
anim.play("nidle")
elif angle == 1:
anim.play("eidle")
elif angle == 3:
anim.play("widle")
else:
anim.play("sidle")
#move_and_slide()

View file

@ -0,0 +1,180 @@
[gd_scene load_steps=14 format=3 uid="uid://ba1erruilgjxo"]
[ext_resource type="Script" path="res://sprites/common/midori/lily.gd" id="1_0lf8i"]
[ext_resource type="Texture2D" uid="uid://cbiin6eb1jqsh" path="res://sprites/common/midori/sprite.png" id="2_lcff3"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dj8gt"]
size = Vector2(86, 68)
[sub_resource type="Animation" id="Animation_i5rhc"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
[sub_resource type="Animation" id="Animation_8my4d"]
resource_name = "eidle"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [6]
}
[sub_resource type="Animation" id="Animation_op07l"]
resource_name = "ewalk"
length = 0.3
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [7, 6, 8]
}
[sub_resource type="Animation" id="Animation_cajcr"]
resource_name = "nidle"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.2),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [3]
}
[sub_resource type="Animation" id="Animation_7lhgw"]
resource_name = "nwalk"
length = 0.3
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [4, 3, 5]
}
[sub_resource type="Animation" id="Animation_w3ius"]
resource_name = "sidle"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
[sub_resource type="Animation" id="Animation_u56r5"]
resource_name = "swalk"
length = 0.3
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [1, 0, 2]
}
[sub_resource type="Animation" id="Animation_isodq"]
resource_name = "widle"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.2),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [9]
}
[sub_resource type="Animation" id="Animation_letwb"]
resource_name = "wwalk"
length = 0.3
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [10, 9, 11]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mh65y"]
_data = {
"RESET": SubResource("Animation_i5rhc"),
"eidle": SubResource("Animation_8my4d"),
"ewalk": SubResource("Animation_op07l"),
"nidle": SubResource("Animation_cajcr"),
"nwalk": SubResource("Animation_7lhgw"),
"sidle": SubResource("Animation_w3ius"),
"swalk": SubResource("Animation_u56r5"),
"widle": SubResource("Animation_isodq"),
"wwalk": SubResource("Animation_letwb")
}
[node name="Lily" type="CharacterBody2D"]
script = ExtResource("1_0lf8i")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_lcff3")
hframes = 3
vframes = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 94)
shape = SubResource("RectangleShape2D_dj8gt")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_mh65y")
}

View file

@ -62,9 +62,9 @@ func _input(event):
bpress = true
var bullet
if Global.debug:
bullet = load(Global.pbbullets[Global.dparty[Global.dcpchar]])
bullet = load(Global.pbbullets[Global.dparty[Global.dcpchar][0]])
else:
bullet = load(Global.pbbullets[Global.party[Global.cpchar]])
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))
@ -82,10 +82,10 @@ 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]]]
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]]]
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]]]
sprite.texture = load(Global.pchars[Global.party[Global.cpchar][0]][Global.party[Global.cpchar][1]])
weakness = Global.specialities[Global.pcspecialities[Global.party[Global.cpchar][0]]]