From 3bfdda8b28e451d2368e71df4a1aa756022bc2db Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 20 Feb 2022 21:07:31 +0100 Subject: [PATCH] Go back to the old skeletal animation based character. Howewer I'll keep the new spritesheet whithout the outline. It looks better with the current setup. This also removed the lights from the characters. I'll add those back later, in a hopefully lot simpler and perofrmant way. --- game/modules/species/Human/Body_2d_old.tscn | 5 ++--- game/player/Body.gd | 9 +++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/game/modules/species/Human/Body_2d_old.tscn b/game/modules/species/Human/Body_2d_old.tscn index b993ab7..400b557 100644 --- a/game/modules/species/Human/Body_2d_old.tscn +++ b/game/modules/species/Human/Body_2d_old.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://player/Body.gd" type="Script" id=1] -[ext_resource path="res://characters/SheetCharacter.tscn" type="PackedScene" id=2] +[ext_resource path="res://characters/Character.tscn" type="PackedScene" id=2] [sub_resource type="CircleShape2D" id=1] radius = 8.0 @@ -9,9 +9,8 @@ radius = 8.0 [node name="Body" type="KinematicBody2D"] script = ExtResource( 1 ) model_path = NodePath("") -character_skeleton_path = NodePath("SheetCharacter") -[node name="SheetCharacter" parent="." instance=ExtResource( 2 )] +[node name="Character" parent="." instance=ExtResource( 2 )] [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 1 ) diff --git a/game/player/Body.gd b/game/player/Body.gd index 0f1bce6..2e2090b 100644 --- a/game/player/Body.gd +++ b/game/player/Body.gd @@ -186,13 +186,10 @@ func process_input(delta: float) -> void: if input_length > 0.1: #handle_graphic_facing(abs(dir.dot(Vector2(0, 1))) > 0.9) - character_skeleton.move_dir(input_dir) - else: - character_skeleton.stand() + character_skeleton.update_facing(input_dir) - #character_skeleton.get_animation_tree().set("parameters/walking/blend_amount", input_dir.length()) - #character_skeleton.set_ - + character_skeleton.get_animation_tree().set("parameters/walking/blend_amount", input_dir.length()) + #character_skeleton.update_facing(input_dir)