diff options
author | nokoe <nokoe@mailbox.org> | 2025-04-07 02:09:57 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2025-04-07 02:09:57 +0200 |
commit | 48a7a20e0f1595cd6e46c8c5136863ed56d5ef2b (patch) | |
tree | 0c700cf46b285887d6c8e582d5c56ced954e77d6 | |
parent | 803645281ad11353bdbbd0ccf4683f203d9554fa (diff) | |
download | hurrycurry-48a7a20e0f1595cd6e46c8c5136863ed56d5ef2b.tar hurrycurry-48a7a20e0f1595cd6e46c8c5136863ed56d5ef2b.tar.bz2 hurrycurry-48a7a20e0f1595cd6e46c8c5136863ed56d5ef2b.tar.zst |
tram model
-rw-r--r-- | client/map/tiles/wall_tile.gd | 2 | ||||
-rw-r--r-- | client/player/character/character.gd | 26 | ||||
-rw-r--r-- | client/player/character/character.tscn | 7 | ||||
-rw-r--r-- | client/player/character/tram/tram.res | bin | 0 -> 35349 bytes | |||
-rw-r--r-- | client/player/character/tram/tram.tscn | 25 | ||||
-rw-r--r-- | data/maps/debug2.yaml | 8 |
6 files changed, 53 insertions, 15 deletions
diff --git a/client/map/tiles/wall_tile.gd b/client/map/tiles/wall_tile.gd index f934e308..49364023 100644 --- a/client/map/tiles/wall_tile.gd +++ b/client/map/tiles/wall_tile.gd @@ -57,7 +57,7 @@ func _init(ctx: TileFactory.TileCC): if max_series == 1: facing = max_idx kind = WallKind.STRAIGHT - if !env.is_empty() and env.has(ctx.neighbors[(facing + 1) % 4]): + if not env.is_empty() and env.has(ctx.neighbors[(facing + 1) % 4]) or ctx.neighbors[(facing + 1) % 4] == null: facing = (facing + 2) % 4 elif max_series == 2: facing = max_idx diff --git a/client/player/character/character.gd b/client/player/character/character.gd index 82e5c849..acdd1c1a 100644 --- a/client/player/character/character.gd +++ b/client/player/character/character.gd @@ -1,6 +1,6 @@ # Hurry Curry! - a game about cooking # Copyright 2024 tpart -# Copyright 2024 nokoe +# Copyright 2024, 2025 nokoe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -23,6 +23,12 @@ const CUSTOMER_MAIN_MESH = preload("res://player/character/customer_body.res") const WALK_ANIM_STRENGTH := 0.05 const WALK_ANIM_SPEED:= 15.0 +enum CharacterKind { + PERSON, + BOT, + TRAM +} + var walking := false var holding := false var boosting := false @@ -61,17 +67,19 @@ const COLORS: Array[Color] = [ class ParsedStyle: var color: int var hair: int - var robot: bool + var kind: CharacterKind = CharacterKind.PERSON var customer: bool func _init(n: int) -> void: customer = n < 0 if customer: n *= -1 - if n == 51: robot = true + if n == 51: kind = CharacterKind.BOT + elif n == 52: kind = CharacterKind.TRAM else: hair = n % NUM_HAIRS color = n / NUM_HAIRS % NUM_COLORS func pack() -> int: - if robot: return 51 + if CharacterKind.BOT: return 51 + elif CharacterKind.TRAM: return 52 return (hair + color * NUM_HAIRS) * (-1 if customer else 1) func _ready(): @@ -103,15 +111,17 @@ func _process(delta): was_boosting = boosting and walking func set_style(id: int): - var p = ParsedStyle.new(id) + var p := ParsedStyle.new(id) main.mesh = CUSTOMER_MAIN_MESH if p.customer else DEFAULT_MAIN_MESH if p.customer: tie.queue_free() - head_robot.visible = p.robot - head_default.visible = not p.robot + head_robot.visible = p.kind == CharacterKind.BOT + head_default.visible = p.kind == CharacterKind.PERSON + $Main.visible = not p.kind == CharacterKind.TRAM + $Tram.visible = p.kind == CharacterKind.TRAM for h in hairstyles: h.hide() hairstyles[p.hair].show() - $Main.get_active_material(0).albedo_color = Color(0.349, 0.349, 0.349) if p.robot else COLORS[p.color] + $Main.get_active_material(0).albedo_color = Color(0.349, 0.349, 0.349) if p.kind == CharacterKind.BOT else COLORS[p.color] func play_animation(name_: String): current_animation = name_ diff --git a/client/player/character/character.tscn b/client/player/character/character.tscn index 5e704bd8..07da7498 100644 --- a/client/player/character/character.tscn +++ b/client/player/character/character.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=28 format=3 uid="uid://b3hhir2fvnunu"] +[gd_scene load_steps=29 format=3 uid="uid://b3hhir2fvnunu"] [ext_resource type="Script" uid="uid://dwk3vd4nv2k65" path="res://player/character/character.gd" id="1_12lbh"] [ext_resource type="ArrayMesh" uid="uid://bnmm01yjwultj" path="res://player/character/default/main.res" id="2_uovyg"] @@ -17,6 +17,7 @@ [ext_resource type="Script" uid="uid://n4jwod1jfuiv" path="res://audio/play_random.gd" id="14_3rb6x"] [ext_resource type="AudioStream" uid="uid://1jsqpnk3igj3" path="res://player/sounds/woosh1.ogg" id="14_ikcec"] [ext_resource type="AudioStream" uid="uid://cwme7eatip0jc" path="res://player/sounds/woosh2.ogg" id="15_iv4wu"] +[ext_resource type="PackedScene" uid="uid://xq5claqewtb3" path="res://player/character/tram/tram.tscn" id="18_8h5ka"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7ojaw"] resource_local_to_scene = true @@ -782,7 +783,7 @@ visible = false [node name="HandAnimations" type="AnimationPlayer" parent="."] libraries = { -"": SubResource("AnimationLibrary_xtrfe") +&"": SubResource("AnimationLibrary_xtrfe") } [node name="Walking" type="CPUParticles3D" parent="."] @@ -845,4 +846,6 @@ billboard = 1 no_depth_test = true text = "Username" +[node name="Tram" parent="." instance=ExtResource("18_8h5ka")] + [connection signal="animation_finished" from="HandAnimations" to="." method="_on_hand_animations_animation_finished"] diff --git a/client/player/character/tram/tram.res b/client/player/character/tram/tram.res Binary files differnew file mode 100644 index 00000000..ae423eb9 --- /dev/null +++ b/client/player/character/tram/tram.res diff --git a/client/player/character/tram/tram.tscn b/client/player/character/tram/tram.tscn new file mode 100644 index 00000000..0aaedbf4 --- /dev/null +++ b/client/player/character/tram/tram.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=5 format=3 uid="uid://xq5claqewtb3"] + +[ext_resource type="ArrayMesh" uid="uid://co1ygecaclgaq" path="res://player/character/tram/tram.res" id="1_lw3pl"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_eboss"] +albedo_color = Color(0.137255, 0.372549, 0.176471, 1) +metallic = 0.42 +roughness = 0.3 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_36qjs"] +metallic = 1.0 +roughness = 0.07 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_c7y58"] +albedo_color = Color(0.129558, 0.129558, 0.129558, 1) + +[node name="Tram" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +mesh = ExtResource("1_lw3pl") +skeleton = NodePath("") +surface_material_override/0 = SubResource("StandardMaterial3D_eboss") +surface_material_override/1 = SubResource("StandardMaterial3D_36qjs") +surface_material_override/2 = SubResource("StandardMaterial3D_c7y58") diff --git a/data/maps/debug2.yaml b/data/maps/debug2.yaml index 154296e6..029d77f3 100644 --- a/data/maps/debug2.yaml +++ b/data/maps/debug2.yaml @@ -30,7 +30,7 @@ map: - "........................" - ".............'''''''''''" - ".............''''''''.''" - - ".............''l''''''''" + - ".............'''''''''''" - ".............'''''''''''" - ".............''l''''''''" - ".............'''''''''''" @@ -97,11 +97,11 @@ entities: - !environment_effect { name: rain, on: 60, off: 40 } - !environment_effect { name: wind, on: 60, off: 40 } - !tram - length: 3 - character: 51 + length: 4 + character: 52 points: [[3, 3], [23, 3], [23, 15], [3, 15]] smoothing: 3. - spacing: 0.2 + spacing: 0.35 chef_spawn: "~" customer_spawn: "!" |