diff options
Diffstat (limited to 'entities')
-rw-r--r-- | entities/player.gd | 40 | ||||
-rw-r--r-- | entities/player.tscn | 24 |
2 files changed, 62 insertions, 2 deletions
diff --git a/entities/player.gd b/entities/player.gd new file mode 100644 index 0000000..ea5e333 --- /dev/null +++ b/entities/player.gd @@ -0,0 +1,40 @@ +class_name Player +extends CharacterBody3D + + +@export var data: PlayerData + + +func _ready() -> void: + %Head.texture = load( + "%s/%s/000.png" % [ + "res://client_data/data/sprite", + Constants.FilePaths.get_player_head( + Client.character.info.gender, + Client.character.info.head + ), + ] + ) + %Head.visible = true + + %Body.texture = load( + "%s/%s/000.png" % [ + "res://client_data/data/sprite", + Constants.FilePaths.get_player_body( + Client.character.info.gender, + Client.character.info.job + ), + ] + ) + + +func set_head(direction: Constants.Direction): + %Head.texture = load( + "%s/%s/000.png" % [ + "res://client_data/data/sprite", + Constants.FilePaths.get_player_head( + Client.character.info.gender, + Client.character.info.head + ), + ] + ) diff --git a/entities/player.tscn b/entities/player.tscn index 4df1bc8..d0fef19 100644 --- a/entities/player.tscn +++ b/entities/player.tscn @@ -1,3 +1,23 @@ -[gd_scene format=3 uid="uid://b2c5mpkafk8q6"] +[gd_scene load_steps=5 format=3 uid="uid://b2c5mpkafk8q6"] -[node name="Player" type="CharacterBody2D"] +[ext_resource type="Script" uid="uid://caid7hva3kg2i" path="res://entities/player.gd" id="1_merdl"] +[ext_resource type="Texture2D" uid="uid://danymuvfjf4o1" path="res://client_data/data/sprite/Àΰ£Á·/¸Ó¸®Åë/³²/16_³²/000.png" id="2_b0kkn"] +[ext_resource type="Texture2D" uid="uid://cwqgdd00sf7pu" path="res://client_data/data/sprite/Àΰ£Á·/¸öÅë/³²/Ãʺ¸ÀÚ_³²/000.png" id="3_e4p34"] +[ext_resource type="PackedScene" uid="uid://kp7ru23t0olg" path="res://client_data/data/sprite/¸ó½ºÅÍ/bombporing/actions.tscn" id="4_rfe5m"] + +[node name="Player" type="CharacterBody3D"] +script = ExtResource("1_merdl") + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 0.704684, 0.709522, 0, -0.709522, 0.704684, 0, 4.6641, 4.76031) + +[node name="Head" type="Sprite3D" parent="."] +unique_name_in_owner = true +offset = Vector2(0, 43) +texture = ExtResource("2_b0kkn") + +[node name="Body" type="Sprite3D" parent="."] +unique_name_in_owner = true +texture = ExtResource("3_e4p34") + +[node name="AnimationPlayer" parent="." instance=ExtResource("4_rfe5m")] |