You can also click the individual map squares to be taken to the "label" corresponding to that location. Right now, I just have each of the squares going back to the "start" label, but you can change this to suit your needs.
To add this code to *your* game, you need to copy the following files into your "game" folder:
-mapscreen.rpy
-mapcomp.rpy
-copy the entire "map" folder, which contains my default images
In addition, you need this code at the start of your script file:
Code: Select all
init python hide:
for file in renpy.list_files():
if file.startswith('map/') and file.endswith('.png'):
name = file.replace('map/', '').replace('.png','')
renpy.image(name, Image(file))
You need this block of code also at the start of your script file:
Code: Select all
init -2 python:
map_a1 = "hidden"
map_a2 = "hidden"
map_a3 = "hidden"
map_a4 = "hidden"
map_a5 = "hidden"
map_a6 = "hidden"
map_a7 = "hidden"
map_b1 = "hidden"
map_b2 = "hidden"
map_b3 = "hidden"
map_b4 = "hidden"
map_b5 = "hidden"
map_b6 = "hidden"
map_b7 = "hidden"
map_c1 = "hidden"
map_c2 = "hidden"
map_c3 = "hidden"
map_c4 = "hidden"
map_c5 = "hidden"
map_c6 = "hidden"
map_c7 = "hidden"
map_d1 = "hidden"
map_d2 = "hidden"
map_d3 = "hidden"
map_d4 = "hidden"
map_d5 = "hidden"
map_d6 = "hidden"
map_d7 = "hidden"
map_e1 = "hidden"
map_e2 = "hidden"
map_e3 = "hidden"
map_e4 = "hidden"
map_e5 = "hidden"
map_e6 = "hidden"
map_e7 = "hidden"
If your game is not already set up with a Quick Menu, you will need to add one.
Add this code to the bottom of your screens.rpy file:
Code: Select all
##############################################################################
# Game Menu
#
# Screen that appears when the player presses the escape button.
image logo = "logo.jpg"
screen game_menu:
tag menu
add "logo"
frame:
xalign .5
yalign .33
has vbox spacing 5
textbutton _("Continue") action Return()
textbutton _("Save Game") action ShowMenu("save")
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Map") action ShowMenu("map")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Main Menu") action MainMenu()
textbutton _("Help") action Help()
textbutton _("Quit") action Quit()
Code: Select all
$ _game_menu_screen = "game_menu" # This code activates the "pause menu" in screens.rpy