summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-07 21:17:47 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-07 21:17:47 +0200
commitfd46def1ebc10d1f2ee4f4447f33e2dfb35986d2 (patch)
tree9d7f17608879ea194afba67636cf52d54d4541a5
parent1406127825e30514dc13909c583895fd682c7107 (diff)
parent793cda76a2bc39680088f655d06d1513b6e05a42 (diff)
downloadhurrycurry-fd46def1ebc10d1f2ee4f4447f33e2dfb35986d2.tar
hurrycurry-fd46def1ebc10d1f2ee4f4447f33e2dfb35986d2.tar.bz2
hurrycurry-fd46def1ebc10d1f2ee4f4447f33e2dfb35986d2.tar.zst
Merge branch 'master' of https://codeberg.org/metamuffin/undercooked
-rw-r--r--client/game.gd2
-rw-r--r--client/menu/controller_buttons/a.svg6
-rw-r--r--client/menu/controller_buttons/x.svg6
-rw-r--r--client/menu/controller_buttons/x.svg.import (renamed from client/menu/controller_buttons/a.svg.import)8
-rw-r--r--client/menu/ingame.gd2
-rw-r--r--client/menu/lobby.tscn7
-rw-r--r--client/player/controllable_player.gd12
-rw-r--r--client/project.godot5
-rw-r--r--data/index.yaml3
-rw-r--r--data/maps/line.yaml4
-rw-r--r--data/maps/rivalry.yaml68
-rw-r--r--data/maps/village.yaml73
-rw-r--r--data/maps/zigzag.yaml71
13 files changed, 249 insertions, 18 deletions
diff --git a/client/game.gd b/client/game.gd
index 0bbc4ab0..671f328f 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -20,6 +20,7 @@ extends Node3D
signal update_players(players: Dictionary)
signal data_updated()
+signal player_set_input_enabled(b: bool)
var player_id: int = -1
var item_names: Array = []
@@ -86,6 +87,7 @@ func _ready():
if player == player_id:
player_instance = ControllablePlayer.new(player, player_name, pos, character, self)
camera.target = player_instance
+ player_set_input_enabled.connect(player_instance.set_input_enabled)
else:
player_instance = Player.new(player, player_name, pos, character, self)
players[player] = player_instance
diff --git a/client/menu/controller_buttons/a.svg b/client/menu/controller_buttons/a.svg
deleted file mode 100644
index 3b660d91..00000000
--- a/client/menu/controller_buttons/a.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs/>
- <g>
- <path stroke="none" fill="#7DB700" d="M56 32 Q56 42 48.95 48.95 42 56 32 56 22.05 56 15 48.95 8 42 8 32 8 22.05 15 15 22.05 8 32 8 42 8 48.95 15 56 22.05 56 32 M38 42 L42 42 34 22 30 22 22 42 26 42 27.6 38 36.4 38 38 42 M32 27 L34.8 34 29.2 34 32 27"/>
- </g>
-</svg> \ No newline at end of file
diff --git a/client/menu/controller_buttons/x.svg b/client/menu/controller_buttons/x.svg
new file mode 100644
index 00000000..9a5df2ea
--- /dev/null
+++ b/client/menu/controller_buttons/x.svg
@@ -0,0 +1,6 @@
+<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs/>
+ <g>
+ <path stroke="none" fill="#009FEB" d="M56 32 Q56 42 48.95 48.95 42 56 32 56 22.05 56 15 48.95 8 42 8 32 8 22.05 15 15 22.05 8 32 8 42 8 48.95 15 56 22.05 56 32 M23 25 L29 32 23 39 23 40 25.25 42 26.4 42 32 35.5 37.65 42 38.75 42 41 40 41 39 35 32 41 25 41 24 38.75 22 37.65 22 32 28.55 26.4 22 25.25 22 23 24 23 25"/>
+ </g>
+</svg> \ No newline at end of file
diff --git a/client/menu/controller_buttons/a.svg.import b/client/menu/controller_buttons/x.svg.import
index 236e085f..f9acb5ec 100644
--- a/client/menu/controller_buttons/a.svg.import
+++ b/client/menu/controller_buttons/x.svg.import
@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
-uid="uid://bgkhnp15u1utp"
-path="res://.godot/imported/a.svg-207eeddefe74f1190424a9aa1808de8f.ctex"
+uid="uid://bsx6fo7mv2u6a"
+path="res://.godot/imported/x.svg-94cb27dd83c134d85e2e1ce8d9481359.ctex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://menu/controller_buttons/a.svg"
-dest_files=["res://.godot/imported/a.svg-207eeddefe74f1190424a9aa1808de8f.ctex"]
+source_file="res://menu/controller_buttons/x.svg"
+dest_files=["res://.godot/imported/x.svg-94cb27dd83c134d85e2e1ce8d9481359.ctex"]
[params]
diff --git a/client/menu/ingame.gd b/client/menu/ingame.gd
index e6ec7c54..61984c99 100644
--- a/client/menu/ingame.gd
+++ b/client/menu/ingame.gd
@@ -14,10 +14,12 @@ func _ready():
func anim_setup(): pass
func menu_anim_open():
print("ingame open")
+ game.player_set_input_enabled.emit(false)
anim.play("activate")
await anim.animation_finished
func menu_anim_exit():
print("ingame exit")
+ game.player_set_input_enabled.emit(true)
anim.play_backwards("activate")
await anim.animation_finished
diff --git a/client/menu/lobby.tscn b/client/menu/lobby.tscn
index 38b2a5b9..df58915c 100644
--- a/client/menu/lobby.tscn
+++ b/client/menu/lobby.tscn
@@ -8,7 +8,7 @@
[ext_resource type="Texture2D" uid="uid://b33qmctbpf48g" path="res://menu/arrow_hover.svg" id="5_odwav"]
[ext_resource type="Texture2D" uid="uid://by3qsrpxnfq4w" path="res://menu/arrow_focus.svg" id="6_tulu3"]
[ext_resource type="PackedScene" uid="uid://b1f7bgn65j7b5" path="res://menu/controller_buttons/controller_button.tscn" id="7_t6mox"]
-[ext_resource type="Texture2D" uid="uid://bgkhnp15u1utp" path="res://menu/controller_buttons/a.svg" id="8_chn2q"]
+[ext_resource type="Texture2D" uid="uid://bsx6fo7mv2u6a" path="res://menu/controller_buttons/x.svg" id="9_q14bw"]
[node name="Lobby" type="Control" groups=["no_auto_focus"]]
layout_mode = 3
@@ -100,10 +100,9 @@ layout_mode = 2
custom_minimum_size = Vector2(148, 0)
layout_mode = 2
text = "Start Game"
-icon = ExtResource("8_chn2q")
expand_icon = true
-controller_texture = ExtResource("8_chn2q")
-press_action = "ui_accept"
+controller_texture = ExtResource("9_q14bw")
+press_action = "start_game"
[connection signal="pressed" from="VBoxContainer/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Left" to="." method="_on_left_pressed"]
[connection signal="pressed" from="VBoxContainer/Bottom/MarginContainer/VBoxContainer/HBoxContainer/Right" to="." method="_on_right_pressed"]
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd
index 8361ca6a..f4c793ae 100644
--- a/client/player/controllable_player.gd
+++ b/client/player/controllable_player.gd
@@ -29,6 +29,7 @@ var facing = Vector2(1, 0)
var velocity_ = Vector2(0, 0)
var stamina = 0
var chat_open := false
+var enable_input := true
var target: Vector2i = Vector2i(0, 0)
@@ -39,7 +40,8 @@ func _ready():
add_child(timer)
timer.start()
timer.connect("timeout", func():
- game.mp.send_position(position_, rotation_, boosting)
+ if game.mp != null:
+ game.mp.send_position(position_, rotation_, boosting)
)
add_child(onscreen_controls)
super()
@@ -52,6 +54,7 @@ func _input(_event):
else:
chat_bubble.edit()
chat_open = !chat_open
+ enable_input = !enable_input
const MAX_DT = 1./50.
func _process(delta):
@@ -62,7 +65,7 @@ func _process(delta):
super(delta)
func _process_movement(delta):
- var input = Input.get_vector("left", "right", "forward", "backwards")
+ var input = Input.get_vector("left", "right", "forward", "backwards") if enable_input else Vector2.ZERO
var boost = Input.is_action_pressed("boost") or (Global.get_setting("latch_boost") and boosting)
input = input.rotated( - game.camera.angle_target)
if Input.is_action_pressed("interact") or Input.is_action_just_released("interact"):
@@ -145,6 +148,8 @@ func take_item(tile: Tile):
Input.start_joy_vibration(0, 0.1, 0.0, 0.075)
func interact():
+ if not enable_input:
+ return
var tile = game.map.get_tile_instance(target)
if tile != null:
game.marker.set_interactive(game.get_tile_interactive(target))
@@ -157,3 +162,6 @@ func interact():
game.mp.send_tile_interact(target, false)
else:
game.marker.visible = false
+
+func set_input_enabled(b: bool):
+ enable_input = b
diff --git a/client/project.godot b/client/project.godot
index 8a9b0003..c8456e23 100644
--- a/client/project.godot
+++ b/client/project.godot
@@ -161,6 +161,11 @@ next={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":null)
]
}
+start_game={
+"deadzone": 0.5,
+"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":true,"script":null)
+]
+}
[internationalization]
diff --git a/data/index.yaml b/data/index.yaml
index f7abdb3b..37229844 100644
--- a/data/index.yaml
+++ b/data/index.yaml
@@ -15,6 +15,9 @@ maps:
- line
- teeny
- bus
+ - rivalry
+ - village
+ - zigzag
recipes:
- none
diff --git a/data/maps/line.yaml b/data/maps/line.yaml
index abb1c25d..1fe5bd99 100644
--- a/data/maps/line.yaml
+++ b/data/maps/line.yaml
@@ -1,9 +1,9 @@
map:
- "'''''''''''''''''''''''''''"
- "''███████████████████████''"
- - "''█ctc.ctc.ctc█##█sSC#LR█''"
+ - "''█ctc.ctc.ctc█pp█sSC#LR█''"
- "!_d...........d..d......d~'"
- - "''█ctc.ctc.ctc█##█#of#TF█X'"
+ - "''█ctc.ctc.ctc█pp█#of#TF█X'"
- "''███████████████████████''"
- "'''''''''''''''''''''''''''"
diff --git a/data/maps/rivalry.yaml b/data/maps/rivalry.yaml
new file mode 100644
index 00000000..016aa154
--- /dev/null
+++ b/data/maps/rivalry.yaml
@@ -0,0 +1,68 @@
+map:
+ - "'''''''''''______''''''''''''''"
+ - "'''''''''''______''''''''''''''"
+ - "''███████c'______'c'c'c'█████''"
+ - "''█SSSos█t'______'t't't'█ppf█''"
+ - "''█'''''█c'______'c'c'c'█...█''"
+ - "''█CC#''d''______'''''''█C.F█''"
+ - "''█'''''█t'______'███dd██C.R█''"
+ - "''█LRFT'█c'______'█.........█''"
+ - "''███████t'______'█T#ss#SooL█''"
+ - "'''pppff'''______'███████████''"
+ - "'''''''''''______''''''''''''''"
+ - "''''''''''X______''''''''''''''"
+ - "''''''''''X______''''''''''''''"
+ - "'''''''''''__~!__''''''''''''''"
+
+
+
+tiles:
+ "#": counter
+ "<": counter
+ ">": counter
+ "v": counter
+ "^": counter
+ "f": counter
+ "p": counter
+ "t": table
+ "w": counter-window
+ "s": sink
+ "o": oven
+ "S": stove
+ "C": cuttingboard
+ "R": raw-steak-crate
+ "T": tomato-crate
+ "F": flour-crate
+ "L": leek-crate
+ "X": trash
+
+ "c": chair
+ ".": floor
+ "'": grass
+ "*": tree
+ "~": path
+ "!": path
+ "_": path
+ "d": door
+ "█": wall
+ "▒": wall-window
+
+items:
+ "S": pot
+ "w": plate
+ "p": plate
+ "f": foodprocessor
+
+chef_spawn: "~"
+customer_spawn: "!"
+
+walkable:
+ - door
+ - floor
+ - chair
+ - grass
+ - path
+
+collider:
+ - wall
+ - tree
diff --git a/data/maps/village.yaml b/data/maps/village.yaml
new file mode 100644
index 00000000..762d4faf
--- /dev/null
+++ b/data/maps/village.yaml
@@ -0,0 +1,73 @@
+map:
+ - "''''''''''''~_''''''''''''"
+ - "''''''''''''__''''''''''''"
+ - "'''████'████__████'████'''"
+ - "'''█CC█'█ff█__█oo█'█SS█'''"
+ - "'''█..d_d.f█__█..d_d..█'''"
+ - "'''████_████__████_████'''"
+ - "''''''X____________X''''''"
+ - "'''████_████__████_████'''"
+ - "'''█..d_d..█__█..d_d.p█'''"
+ - "'''█LR█'█FT█__█ss█'█pp█'''"
+ - "'''████'████__████'████'''"
+ - "''''ctc'ctc.__.ctc'ctc''''"
+ - "''''ctc'ctc.__.ctc'ctc''''"
+ - "'''''________________'''''"
+ - "''''ctc.ctc.__.ctc.ctc''''"
+ - "''''ctc.ctc.__.ctc.ctc''''"
+ - "'''''________________'''''"
+ - "''''ctc.ctc'__'ctc.ctc''''"
+ - "''''ctc.ctc'__'ctc.ctc''''"
+ - "''''''''''''__''''''''''''"
+ - "''''''''''''_!''''''''''''"
+
+tiles:
+ "#": counter
+ "<": counter
+ ">": counter
+ "v": counter
+ "^": counter
+ "f": counter
+ "p": counter
+ "t": table
+ "w": counter-window
+ "s": sink
+ "o": oven
+ "S": stove
+ "C": cuttingboard
+ "R": raw-steak-crate
+ "T": tomato-crate
+ "F": flour-crate
+ "L": leek-crate
+ "X": trash
+
+ "c": chair
+ ".": floor
+ "'": grass
+ "*": tree
+ "~": path
+ "!": path
+ "_": path
+ "d": door
+ "█": wall
+ "▒": wall-window
+
+items:
+ "S": pot
+ "w": plate
+ "p": plate
+ "f": foodprocessor
+
+chef_spawn: "~"
+customer_spawn: "!"
+
+walkable:
+ - door
+ - floor
+ - chair
+ - grass
+ - path
+
+collider:
+ - wall
+ - tree
diff --git a/data/maps/zigzag.yaml b/data/maps/zigzag.yaml
new file mode 100644
index 00000000..2a1d749e
--- /dev/null
+++ b/data/maps/zigzag.yaml
@@ -0,0 +1,71 @@
+map:
+ - "''''''''''''''''''"
+ - "'████████████████'"
+ - "'█vLLRRFFTT####X█'"
+ - "'█v............^█'"
+ - "'█v..ppppppff##^█'"
+ - "'█v............^█'"
+ - "'█voooo######..^█'"
+ - "'█v............^█'"
+ - "'█v..#######ss#^█'"
+ - "'█v............^█'"
+ - "'█vSSS#######..^█'"
+ - "'█v............^█'"
+ - "'█X..######CCC#^█'"
+ - "'█..............█'"
+ - "'█.tttttttttttt.█'"
+ - "'█.cccccccccccc.█'"
+ - "'█..............█'"
+ - "''______!~______''"
+
+
+tiles:
+ "#": counter
+ "<": counter
+ ">": counter
+ "v": counter
+ "^": counter
+ "f": counter
+ "p": counter
+ "t": table
+ "w": counter-window
+ "s": sink
+ "o": oven
+ "S": stove
+ "C": cuttingboard
+ "R": raw-steak-crate
+ "T": tomato-crate
+ "F": flour-crate
+ "L": leek-crate
+ "X": trash
+
+ "c": chair
+ ".": floor
+ "'": grass
+ "*": tree
+ "~": path
+ "!": path
+ "_": path
+ "d": door
+ "█": wall
+ "▒": wall-window
+
+items:
+ "S": pot
+ "w": plate
+ "p": plate
+ "f": foodprocessor
+
+chef_spawn: "~"
+customer_spawn: "!"
+
+walkable:
+ - door
+ - floor
+ - chair
+ - grass
+ - path
+
+collider:
+ - wall
+ - tree