more work on inventory

This commit is contained in:
2023-02-05 22:38:50 -05:00
parent d7572b48cc
commit 836a0e4a93
22 changed files with 613 additions and 68 deletions

View File

@@ -227,9 +227,6 @@ func _physics_process(delta):
# $Networking.flipped_h = player_sprite.flip_h
# $Networking.sync_frame_coords = player_sprite.get_frame_coords()
func move_player(c_velocity: Vector2):
# rpc(&'update_movement', velocity)
var collided = move_and_collide(c_velocity)
@@ -240,3 +237,6 @@ func move_player(c_velocity: Vector2):
# var normal = collision.get_normal()
# collider.apply_central_impulse(-collision.get_normal() * push_power)
player_hit.is_player_hit = false
func set_context_label(text: String):
$CanvasLayer/ContextLabel.set_text(text)

View File

@@ -1,13 +1,14 @@
[gd_scene load_steps=22 format=3 uid="uid://c1gncjamuavvs"]
[gd_scene load_steps=23 format=3 uid="uid://c1gncjamuavvs"]
[ext_resource type="Script" path="res://Characters/test_player/test_player.gd" id="1_6aci1"]
[ext_resource type="Texture2D" uid="uid://cs5o8bykug82q" path="res://Characters/test_player/WARRIOR SKELETON SS 2.png" id="1_8pmbp"]
[ext_resource type="PackedScene" uid="uid://0ou4asf4vsc1" path="res://UI/Inventory/Inventory.tscn" id="3_fol83"]
[ext_resource type="PackedScene" uid="uid://drr0ptd6k6uch" path="res://UI/Inventory/UserInventory.tscn" id="3_nvr35"]
[ext_resource type="FontFile" uid="uid://dj4pldmxeqmtt" path="res://UI/PressStart2P-Regular.ttf" id="4_i8vjo"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3qub5"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_g1om0"]
size = Vector2(22, 20)
[sub_resource type="Animation" id="Animation_v17mb"]
[sub_resource type="Animation" id="Animation_5n6gk"]
resource_name = "attack"
length = 0.65
tracks/0/type = "value"
@@ -23,7 +24,7 @@ tracks/0/keys = {
"values": [Vector2i(0, 5), Vector2i(1, 5), Vector2i(2, 5), Vector2i(3, 5)]
}
[sub_resource type="Animation" id="Animation_dhyjd"]
[sub_resource type="Animation" id="Animation_u6kdu"]
resource_name = "damage"
step = 0.01
tracks/0/type = "value"
@@ -39,7 +40,7 @@ tracks/0/keys = {
"values": [Color(0.792157, 0.0901961, 0.0901961, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(0.792157, 0.0901961, 0.0901961, 1), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_jals6"]
[sub_resource type="Animation" id="Animation_ybwuj"]
resource_name = "die"
tracks/0/type = "value"
tracks/0/imported = false
@@ -54,7 +55,7 @@ tracks/0/keys = {
"values": [Vector2i(0, 4), Vector2i(1, 4), Vector2i(2, 4), Vector2i(3, 4), Vector2i(4, 4)]
}
[sub_resource type="Animation" id="Animation_mhxr4"]
[sub_resource type="Animation" id="Animation_h5uv5"]
resource_name = "idle"
length = 2.0
loop_mode = 1
@@ -71,7 +72,7 @@ tracks/0/keys = {
"values": [Vector2i(0, 0), Vector2i(1, 0), Vector2i(2, 0), Vector2i(3, 0), Vector2i(4, 0)]
}
[sub_resource type="Animation" id="Animation_5kwsw"]
[sub_resource type="Animation" id="Animation_cev5d"]
resource_name = "walk"
loop_mode = 1
step = 0.01
@@ -88,62 +89,62 @@ tracks/0/keys = {
"values": [Vector2i(0, 1), Vector2i(1, 1), Vector2i(2, 1), Vector2i(3, 1), Vector2i(4, 1), Vector2i(5, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mfcw3"]
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5qwfv"]
_data = {
"attack": SubResource("Animation_v17mb"),
"damage": SubResource("Animation_dhyjd"),
"die": SubResource("Animation_jals6"),
"idle": SubResource("Animation_mhxr4"),
"walk": SubResource("Animation_5kwsw")
"attack": SubResource("Animation_5n6gk"),
"damage": SubResource("Animation_u6kdu"),
"die": SubResource("Animation_ybwuj"),
"idle": SubResource("Animation_h5uv5"),
"walk": SubResource("Animation_cev5d")
}
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_lqar1"]
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_2a8v8"]
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_vr7py"]
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_5013i"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_d7310"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_24wrp"]
animation = &"attack"
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_83svy"]
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_2lwq2"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ixc0x"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mfi5b"]
animation = &"damage"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_wmn47"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_yud6d"]
animation = &"die"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_poall"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0n1hp"]
animation = &"idle"
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_cxexk"]
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_qrdax"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6a4lj"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6pfdq"]
animation = &"walk"
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_4pmjh"]
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_78n1d"]
graph_offset = Vector2(-769.911, -161.25)
nodes/AttackOneShot/node = SubResource("AnimationNodeOneShot_lqar1")
nodes/AttackOneShot/node = SubResource("AnimationNodeOneShot_2a8v8")
nodes/AttackOneShot/position = Vector2(-320, 60)
nodes/DieOneShot/node = SubResource("AnimationNodeOneShot_vr7py")
nodes/DieOneShot/node = SubResource("AnimationNodeOneShot_5013i")
nodes/DieOneShot/position = Vector2(-120, 180)
nodes/attack_anim/node = SubResource("AnimationNodeAnimation_d7310")
nodes/attack_anim/node = SubResource("AnimationNodeAnimation_24wrp")
nodes/attack_anim/position = Vector2(-560, 200)
nodes/damageOneShot/node = SubResource("AnimationNodeOneShot_83svy")
nodes/damageOneShot/node = SubResource("AnimationNodeOneShot_2lwq2")
nodes/damageOneShot/position = Vector2(100, 320)
nodes/damage_anim/node = SubResource("AnimationNodeAnimation_ixc0x")
nodes/damage_anim/node = SubResource("AnimationNodeAnimation_mfi5b")
nodes/damage_anim/position = Vector2(-200, 460)
nodes/die_anim/node = SubResource("AnimationNodeAnimation_wmn47")
nodes/die_anim/node = SubResource("AnimationNodeAnimation_yud6d")
nodes/die_anim/position = Vector2(-440, 340)
nodes/idle_anim/node = SubResource("AnimationNodeAnimation_poall")
nodes/idle_anim/node = SubResource("AnimationNodeAnimation_0n1hp")
nodes/idle_anim/position = Vector2(-940, 60)
nodes/output/position = Vector2(400, 340)
nodes/walkIdleBlend/node = SubResource("AnimationNodeBlend2_cxexk")
nodes/walkIdleBlend/node = SubResource("AnimationNodeBlend2_qrdax")
nodes/walkIdleBlend/position = Vector2(-660, -40)
nodes/walk_anim/node = SubResource("AnimationNodeAnimation_6a4lj")
nodes/walk_anim/node = SubResource("AnimationNodeAnimation_6pfdq")
nodes/walk_anim/position = Vector2(-920, -80)
node_connections = [&"output", 0, &"damageOneShot", &"AttackOneShot", 0, &"walkIdleBlend", &"AttackOneShot", 1, &"attack_anim", &"DieOneShot", 0, &"AttackOneShot", &"DieOneShot", 1, &"die_anim", &"damageOneShot", 0, &"DieOneShot", &"damageOneShot", 1, &"damage_anim", &"walkIdleBlend", 0, &"walk_anim", &"walkIdleBlend", 1, &"idle_anim"]
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_n4dy6"]
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_hr3p8"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/sync = true
@@ -162,23 +163,23 @@ motion_mode = 1
script = ExtResource("1_6aci1")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(1, 2)
shape = SubResource("RectangleShape2D_3qub5")
shape = SubResource("RectangleShape2D_g1om0")
[node name="Sprite2D" type="Sprite2D" parent="."]
z_index = 1
position = Vector2(-1, -2)
texture = ExtResource("1_8pmbp")
hframes = 6
vframes = 6
frame = 4
frame = 1
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_mfcw3")
"": SubResource("AnimationLibrary_5qwfv")
}
[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource("AnimationNodeBlendTree_4pmjh")
tree_root = SubResource("AnimationNodeBlendTree_78n1d")
anim_player = NodePath("../AnimationPlayer")
active = true
parameters/AttackOneShot/active = false
@@ -191,13 +192,21 @@ parameters/walkIdleBlend/blend_amount = 1.0
[node name="player_cam" type="Camera2D" parent="."]
modulate = Color(0, 0, 0, 1)
zoom = Vector2(2, 2)
[node name="InvulnerableTimer" type="Timer" parent="."]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Inventory" parent="CanvasLayer" instance=ExtResource("3_fol83")]
mouse_filter = 2
[node name="UserInventory" parent="CanvasLayer" instance=ExtResource("3_nvr35")]
[node name="ContextLabel" type="Label" parent="CanvasLayer"]
offset_left = 463.0
offset_top = 281.0
offset_right = 703.0
offset_bottom = 304.0
size_flags_horizontal = 4
theme_override_fonts/font = ExtResource("4_i8vjo")
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_n4dy6")
replication_config = SubResource("SceneReplicationConfig_hr3p8")