Skip to content

Commit

Permalink
Feat: New graphics for room 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Balloonpopper authored and StraToN committed Mar 8, 2022
1 parent 7e6fb7b commit 7a64c77
Show file tree
Hide file tree
Showing 10 changed files with 310 additions and 101 deletions.
Binary file added game/rooms/room08/door.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions game/rooms/room08/esc/button_puzzle.esc
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
:look
say player "That must be the command to open the door."
say player "That's the button to open the door."

:use
> [!r8_m_door_open]
#superpose_scene "res://game/rooms/room08/puzzle/10_buttons_puzzle.tscn"
# Load the puzzle
spawn puzzle "res://game/rooms/room08/puzzle/10_buttons_puzzle.tscn"

> [r8_m_door_open]
say player "The door is already open."

# Currently the button gets disabled when you beat the puzzle, so there's
# no button you can interract with. If you set it up so the button was
# still enabled, this code would provide feedback to the user if they
# attempted to "use" the already unlocked puzzle.
#> [r8_m_door_open]
# say player "The door is already open."
18 changes: 15 additions & 3 deletions game/rooms/room08/esc/button_reset_puzzle.esc
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
:look
say player "That must be the command to open the door."
say player "That's the button to relock the door."

:use
set_global r8_m_door_open false
set_state r8_m_door door_close
> [r8_m_door_open]
# If the door is unlocked, reset the puzzle.
# Set the door open to false so the room gets set up
# correctly if you exit and reenter
set_global r8_m_door_open false
# Play the door closing animation to "relock" the door
set_state r8_m_door door_close
# Reactivate the puzzle button so the player can redo
# the puzzle and unlock the door again
set_active r8_mini_puzzle_button true
stop
> [!r8_m_door_open]
# Don't reset the puzzle if the door is currently locked
say player "The puzzle doesn't need to be reset"
14 changes: 13 additions & 1 deletion game/rooms/room08/esc/middle_exit.esc
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
:look
say player "That's the door to room 9"

:exit_scene
change_scene "res://game/rooms/room09/room09.tscn"
> [r8_m_door_open]
# Only let the player into the next room if they've passed the puzzle
change_scene "res://game/rooms/room09/room09.tscn"

> [!r8_m_door_open]
# The door is always an exit, but trying to go through it won't change
# scenes if you haven't unlocked the puzzle.
say player "The door is locked"


15 changes: 15 additions & 0 deletions game/rooms/room08/esc/room08.esc
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
:setup

# This code will run only the first time you enter the room.
> [!room8_visited]
set_global room8_visited true
set_global r8_m_door_open false
# Activate locked puzzle button the first time you enter the room only.
# It will keep it's locked/unlocked state on future room entrances.
# It should already be active, this is a safety precaution.
set_active r8_mini_puzzle_button true

> [r8_m_door_open]
# If the door was previously opened, quickly play the open animation
# so you don't see a closed door when the room appears.
set_state r8_m_door door_open true
# Hide locked puzzle icon and make the button non-interactive as
# the puzzle was previously unlocked
set_active r8_mini_puzzle_button false


> [eq ESC_LAST_SCENE room7]
teleport player r8_l_exit
Expand Down
Binary file added game/rooms/room08/locked_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions game/rooms/room08/puzzle/10_buttons_puzzle.gd
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func win():
escoria.main.current_scene.show()
escoria.globals_manager.set_global("r8_m_door_open", true)
escoria.object_manager.get_object("r8_m_door").set_state("door_open")
escoria.object_manager.get_object("r8_mini_puzzle_button").active = false


func _on_quit_pressed():
Expand Down
Loading

0 comments on commit 7a64c77

Please sign in to comment.