From 35b0f811f23f029110373798b19d9d0895d907f0 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 5 Jan 2025 16:54:36 +0100 Subject: next commit --- entities/player.gd | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 entities/player.gd (limited to 'entities/player.gd') 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 + ), + ] + ) -- cgit v1.2.3