Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cooperative Cuisine Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Commits
7b893d7b
Commit
7b893d7b
authored
1 year ago
by
Fabian Heinrich
Browse files
Options
Downloads
Patches
Plain Diff
New image for showing which buttons to press to continue
parent
3bbc6584
No related branches found
No related tags found
1 merge request
!62
Resolve "Game Flow"
Pipeline
#46991
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
overcooked_simulator/gui_2d_vis/continue.drawio.png
+0
-0
0 additions, 0 deletions
overcooked_simulator/gui_2d_vis/continue.drawio.png
overcooked_simulator/gui_2d_vis/overcooked_gui.py
+17
-14
17 additions, 14 deletions
overcooked_simulator/gui_2d_vis/overcooked_gui.py
with
17 additions
and
14 deletions
overcooked_simulator/gui_2d_vis/continue.drawio.png
0 → 100644
+
0
−
0
View file @
7b893d7b
644 KiB
This diff is collapsed.
Click to expand it.
overcooked_simulator/gui_2d_vis/overcooked_gui.py
+
17
−
14
View file @
7b893d7b
...
...
@@ -437,18 +437,18 @@ class PyGameGUI:
)
img
=
pygame
.
image
.
load
(
ROOT_DIR
/
"
gui_2d_vis
"
/
"
press_a
.drawio.png
"
ROOT_DIR
/
"
gui_2d_vis
"
/
"
continue
.drawio.png
"
).
convert_alpha
()
image_rect
=
img
.
get_rect
()
image_rect
.
centery
+=
6
0
image_rect
.
centery
+=
8
0
self
.
press_a_image
=
pygame_gui
.
elements
.
UIImage
(
image_rect
,
img
,
manager
=
self
.
manager
,
anchors
=
{
"
centerx
"
:
"
centerx
"
,
"
centery
"
:
"
centery
"
},
)
img_width
=
self
.
buttons_width
img_width
=
self
.
buttons_width
*
1.5
img_height
=
img_width
*
(
image_rect
.
height
/
image_rect
.
width
)
new_dims
=
(
img_width
,
img_height
)
self
.
press_a_image
.
set_dimensions
(
new_dims
)
...
...
@@ -467,7 +467,7 @@ class PyGameGUI:
(
0
,
0
),
(
self
.
window_width
*
0.9
,
(
self
.
window_height
//
3
),
(
self
.
window_height
//
4
),
),
)
player_selection_rect
.
bottom
=
-
10
...
...
@@ -803,7 +803,7 @@ class PyGameGUI:
self
.
tutorial_image
,
self
.
quit_button
,
self
.
continue_button
,
self
.
fullscreen_button
self
.
fullscreen_button
,
]
self
.
pregame_screen_elements
=
[
...
...
@@ -826,8 +826,7 @@ class PyGameGUI:
self
.
conclusion_label
,
self
.
quit_button
,
self
.
next_game_button
,
self
.
finish_study_button
self
.
finish_study_button
,
]
self
.
end_screen_elements
=
[
...
...
@@ -865,7 +864,6 @@ class PyGameGUI:
if
self
.
CONNECT_WITH_STUDY_SERVER
:
self
.
bot_number_container
.
hide
()
self
.
update_selection_elements
()
case
MenuStates
.
ControllerTutorial
:
self
.
show_screen_elements
(
self
.
tutorial_screen_elements
)
...
...
@@ -1083,7 +1081,6 @@ class PyGameGUI:
self
.
player_ids
=
[
str
(
list
(
self
.
player_info
.
keys
())[
0
])]
def
get_game_connection
(
self
,
tutorial
):
if
self
.
menu_state
==
MenuStates
.
ControllerTutorial
:
self
.
player_info
=
requests
.
post
(
f
"
http://localhost:8080/connect_to_tutorial/
{
self
.
participant_id
}
"
...
...
@@ -1185,8 +1182,6 @@ class PyGameGUI:
self
.
state_player_id
=
player_id
def
setup_game
(
self
,
tutorial
=
False
):
if
self
.
CONNECT_WITH_STUDY_SERVER
:
self
.
get_game_connection
(
tutorial
)
else
:
...
...
@@ -1422,7 +1417,6 @@ class PyGameGUI:
case
self
.
continue_button
:
self
.
exit_tutorial
()
############################################
case
MenuStates
.
PreGame
:
...
...
@@ -1518,7 +1512,17 @@ class PyGameGUI:
# Press key instead of mouse button press
if
(
event
.
type
==
pygame
.
JOYBUTTONDOWN
and
any
([
self
.
joysticks
and
self
.
joysticks
[
i
].
get_button
(
7
)
for
i
in
range
(
len
(
self
.
joysticks
))])
or
event
.
type
==
pygame
.
KEYDOWN
and
event
.
key
==
pygame
.
K_RETURN
event
.
type
==
pygame
.
JOYBUTTONDOWN
and
any
(
[
self
.
joysticks
and
self
.
joysticks
[
i
].
get_button
(
7
)
for
i
in
range
(
len
(
self
.
joysticks
))
]
)
or
(
event
.
type
==
pygame
.
KEYDOWN
and
event
.
key
==
pygame
.
K_RETURN
)
):
match
self
.
menu_state
:
case
MenuStates
.
Start
:
...
...
@@ -1586,7 +1590,6 @@ class PyGameGUI:
self
.
disconnect_websockets
()
def
main
(
url
:
str
,
port
:
int
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment