aboutsummaryrefslogtreecommitdiff
path: root/client/player
diff options
context:
space:
mode:
Diffstat (limited to 'client/player')
-rw-r--r--client/player/character/character.gd14
-rw-r--r--client/player/character/character.tscn16
-rw-r--r--client/player/character/hair_2.resbin0 -> 16368 bytes
-rw-r--r--client/player/character/hair_3.resbin0 -> 19738 bytes
-rw-r--r--client/player/controllable_player.gd4
5 files changed, 31 insertions, 3 deletions
diff --git a/client/player/character/character.gd b/client/player/character/character.gd
index 76e7b6b3..dd3e6554 100644
--- a/client/player/character/character.gd
+++ b/client/player/character/character.gd
@@ -29,6 +29,12 @@ var current_animation := "idle"
@onready var default_height = main.position.y
@onready var main_height_target = default_height
+@onready var hairstyles = {
+ "Brown": $Main/Head/Hair,
+ "Blond": $Main/Head/Hair2,
+ "E. Parsley": $Main/Head/Hair3
+}
+
func _ready():
play_animation("idle")
@@ -53,6 +59,14 @@ func _process(delta):
if current_animation != next_animation:
play_animation(next_animation)
+func select_hairstyle(id: int):
+ var target = hairstyles.keys()[id]
+ for k in hairstyles.keys():
+ if k == target:
+ hairstyles[k].show()
+ else:
+ hairstyles[k].hide()
+
func play_animation(name_: String):
current_animation = name_
hand_animations.play(name_)
diff --git a/client/player/character/character.tscn b/client/player/character/character.tscn
index d33a424e..033135cd 100644
--- a/client/player/character/character.tscn
+++ b/client/player/character/character.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=13 format=3 uid="uid://b3hhir2fvnunu"]
+[gd_scene load_steps=15 format=3 uid="uid://b3hhir2fvnunu"]
[ext_resource type="Script" path="res://player/character/character.gd" id="1_12lbh"]
[ext_resource type="ArrayMesh" uid="uid://bnmm01yjwultj" path="res://player/character/main.res" id="2_lxdbd"]
@@ -6,7 +6,9 @@
[ext_resource type="ArrayMesh" uid="uid://r52cylox4imf" path="res://player/character/hand_left.res" id="4_ellbc"]
[ext_resource type="ArrayMesh" uid="uid://csryncouqhwp1" path="res://player/character/head.res" id="5_tyg2e"]
[ext_resource type="ArrayMesh" uid="uid://bsxmxq4dfv2vy" path="res://player/character/hair.res" id="6_rfl5m"]
+[ext_resource type="ArrayMesh" uid="uid://dx7jswwaesok4" path="res://player/character/hair_2.res" id="7_0551e"]
[ext_resource type="ArrayMesh" uid="uid://c2qnwt44x8ujl" path="res://player/character/tie.res" id="7_knv6q"]
+[ext_resource type="ArrayMesh" uid="uid://c5qsthvtf3cta" path="res://player/character/hair_3.res" id="8_2bc5u"]
[sub_resource type="Animation" id="Animation_tdhvg"]
length = 0.001
@@ -591,6 +593,18 @@ transform = Transform3D(1.06667, 0, 0, 0, 1.06667, 0, 0, 0, 1.06667, 0, 0.4, 0)
mesh = ExtResource("6_rfl5m")
skeleton = NodePath("")
+[node name="Hair2" type="MeshInstance3D" parent="Main/Head"]
+transform = Transform3D(1.06667, 0, 0, 0, 1.06667, 0, 0, 0, 1.06667, 0, 0.4, 0)
+visible = false
+mesh = ExtResource("7_0551e")
+skeleton = NodePath("")
+
+[node name="Hair3" type="MeshInstance3D" parent="Main/Head"]
+transform = Transform3D(1.06667, 0, 0, 0, 1.06667, 0, 0, 0, 1.06667, 0, 0.4, 0)
+visible = false
+mesh = ExtResource("8_2bc5u")
+skeleton = NodePath("")
+
[node name="Tie" type="MeshInstance3D" parent="Main"]
transform = Transform3D(0.125, 0, 0, 0, 0.125, 0, 0, 0, 0.125, 0, 0.47772, 0.445265)
mesh = ExtResource("7_knv6q")
diff --git a/client/player/character/hair_2.res b/client/player/character/hair_2.res
new file mode 100644
index 00000000..5d41a4b5
--- /dev/null
+++ b/client/player/character/hair_2.res
Binary files differ
diff --git a/client/player/character/hair_3.res b/client/player/character/hair_3.res
new file mode 100644
index 00000000..911afa30
--- /dev/null
+++ b/client/player/character/hair_3.res
Binary files differ
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd
index 7d143a60..3012f557 100644
--- a/client/player/controllable_player.gd
+++ b/client/player/controllable_player.gd
@@ -18,7 +18,7 @@ class_name ControllablePlayer
extends Player
-const PLAYER_SPEED: float = 25.;
+const PLAYER_SPEED: float = 65.;
var facing = Vector2(1, 0)
var velocity_ = Vector2(0, 0)
@@ -59,7 +59,7 @@ func update(dt: float, input: Vector2):
self.facing = direction + (self.facing - direction) * exp(-dt * 10.);
self.velocity_ += direction * dt * PLAYER_SPEED;
self.position_ += self.velocity_ * dt;
- self.velocity_ = self.velocity_ * exp(-dt * 5.);
+ self.velocity_ = self.velocity_ * exp(-dt * 15.);
collide(dt);
func collide(dt: float):