BrokenGate - Decker Point and Click Game Template
BrokenGate - A Decker Template
This stated off as a full macventure style game, but December is not a time for a lot of writing and adventure games do have a lot of writing. So I'm releasing this as a short adventure to unlock the front door.
Using the Template
This documentation for the template is assuming that you are familiar with the basics of Decker. The way I do things here is not endorsed by the creator of Decker as a standard, this was just the easiest way I could make things work.
Setting the Scene - Room
- Create a new card
- Add the new contraption "Game_UI"
- Double Click the contraption, change the name to "G" without quotes.
- Under the Widgets menu, click "Show Transparent"
- If there is ever an issue were the UI is covering your Widgets, select the Game_UI and choose Move to Back
Interacting with the Game_UI Widget
Once you have properly named the Game_UI widget to G you can use the default interaction script to provide text box responses as you interact with things. See downloads for the default script.
Storing State
- Create a new card called "f" without quotes
- This card will store widgets we create as a way to track state.
Creating the Flag
# When creating a widget to track state, we need to make sure that we check if the state # was already set because decker will be helpful and create a widget with a different name # if your state exists # Name of your flag, make sure it's unique. CHECK_FLAG:"Flag_0001" # Check if it exists, if it does not add the widget to track state. if deck.cards["f"].widgets[CHECK_FLAG] = 0 deck.cards["f"].add["button" CHECK_FLAG] end
Checking the Flag
# Name of your flag, make sure it's unique. CHECK_FLAG:"Flag_0001" # Check if it exists, if it does not add the widget to track state. if deck.cards["f"].widgets[CHECK_FLAG] = 0 # If the flag is not set, do this else # If the flag is set, do this end
Default Text Settings
#This is set in the Deck Script so you can access it anywhere. #Short Name o:() # We're using Internet Janitor's paper contraption for the textbox o.border:deck.contraptions.paper # Standard Colors and Font o.fcolor:colors.black o.bcolor:colors.white o.tfont:"cinema"
One Time Room Text
# Name of your flag, make sure it's unique. CHECK_FLAG:"Room_Flag_0001" on view do if deck.cards["f"].widgets[CHECK_FLAG] = 0 f.add["button" CHECK_FLAG] dd.open[deck o] dd.say["This is the text that shows one time as you see a room."] dd.close[] end end
Death Rooms
# Since death kicks you back to the room you were last in, you can just copy the # death card and make a new card for each death to return you to the last room. on view do play["death"] dd.open[deck o] dd.say["Reaper: I bet you're BERRY sorry now!"] play["click"] dd.say["Reaper: Haha, I love your face when you hear my jokes."] play["click"] dd.say["Reaper: Sending you back ;)"] play["click"] dd.close[] go["r01" "Dissolve"] end
About Text
The text uses the Dialog system by Internet Janitor, you can open the dialog.deck from the examples folder to see how it works and what other features you can use.
Objects that Change on the Map
# In the room script, we update the state of the widget we want to show and hide. on view do CHECK_FLAG:"Item_Flag_0001" # Show or hide birb if deck.cards["f"].widgets[CHECK_FLAG] then birb.show:"none" else birb.show:"transparent" end end
Example, Speaking to Bird Picks it Up
#---------------------------------------------# # SPEAK #---------------------------------------------# CHECK_FLAG:"Item_Flag_0001" if G.verb = "Speak" dd.open[deck o] # See the example script in downloads for _speak details. dd.say[_speak] dd.close[] if deck.cards["f"].widgets[CHECK_FLAG] then else deck.cards["f"].add["button" CHECK_FLAG] # We alert to force the room to update and the room to refresh. # We could also go["card_name"] as well. alert["Item: ANIMAL FRIENDS - Bird added"] end end
Creating Fonts
I've included the font-creation tool in downloads that Internet Janitor outlines in the tutorial here. You can use it to create fonts to best fit your game.
Jam
Created for Deck-Month, which had the theme: Decker Games.