A important location in the story/game is the city's storm drains, a maze of tunnels with several entrance/exit points, designed to confound typical maze solving techniques and confuse/disorientate the player, such as the back button is more of a U-turn button, where what was on the right is now on the left as if you turned around. I plan on adding several things to make solving it easier, but for now I'm just trying to get the point and click movement mechanics down. The layout is a 29 X 29X ? XYZ grid (The Z is static at the moment, and a place holder in case I add more layers). And each tunnel section has a XYZ location, with about 350 sections.
What I've done so far seems to be working fine, but I'm just concerned with the number of "call screens" I'm going to hit a point where stability/memory leaks will become an issue. Also, with over 2000 lines of code so far, and less than half of the tunnels done, I'm wondering if there cleaner way to code this.
A sample of the code so far:
Code: Select all
image SD_B_R = "scenes/tunnle_pics/SD_B_R.png"
image SD_B_L = "scenes/tunnle_pics/SD_B_L.png"
image SD_T_1 = "scenes/tunnle_pics/SD_T_1.png"
image SD_T_2 = "scenes/tunnle_pics/SD_T_2.png"
image SD_T_3 = "scenes/tunnle_pics/SD_T_3.png"
image SD_S_1 = "scenes/tunnle_pics/SD_S_1.png"
image SD_E_LAD = "scenes/tunnle_pics/SD_E_LAD.png"
image SD_X_1 = "scenes/tunnle_pics/SD_X_1.png"
image SD_E_2 = "scenes/tunnle_pics/SD_E_2.png"
label stormdrains:
scene black
if (loc1 == "x24y12z4"):
hide SD_T_3
hide SD_T_1
hide SD_T_2
show SD_E_LAD
call screen x24y12z4
screen x24y12z4:
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x24y12z4a")] xpos 500 ypos 600
imagebutton auto "maps/arrow_F_%s.png" action [Jump("outside")] xpos 600 ypos 200
label x24y12z4a:
$ p_min +=1
if (p_min > 59):
$ p_min -=60
call time_call_1
if (loc1 == "x24y12z4"):
hide SD_E_LAD
hide SD_T_3
hide SD_T_1
hide SD_T_2
show SD_S_1 with ffade
call screen x24y12z4a
screen x24y12z4a:
imagebutton auto "maps/arrow_F_%s.png" action [Jump("x23y12z4")] xpos 500 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("stormdrains")] xpos 500 ypos 650
elif (loc1 == "x23y12z4"):
hide SD_T_3
hide SD_T_1
hide SD_T_2
show SD_E_LAD with ffade
$loc1 = "x24y12z4"
call screen x24y12z4c
screen x24y12z4c:
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x24y12z4a")] xpos 500 ypos 650
imagebutton auto "maps/arrow_F_%s.png" action [Jump("outside")] xpos 600 ypos 200
label x23y12z4:
$ p_min +=1
if (p_min > 59):
$ p_min -=60
call time_call_1
if (loc1 == "x24y12z4"):
hide SD_E_LAD
hide SD_S_1
show SD_T_3 with ffade
$ loc1 = "x23y12z4"
call screen x23y12z4a
screen x23y12z4a:
imagebutton auto "maps/arrow_F_%s.png" action [Jump("x22y12z4")] xpos 500 ypos 350
imagebutton auto "maps/arrow_R_%s.png" action [Jump("x23y13z4")] xpos 900 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("stormdrains")] xpos 500 ypos 650
elif (loc1 == "x22y12z4"):
hide SD_E_LAD
hide SD_S_1
show SD_T_1 with ffade
$ loc1 = "x23y12z4"
call screen x23y12z4b
screen x23y12z4b:
imagebutton auto "maps/arrow_F_%s.png" action [Jump("x24y12z4a")] xpos 500 ypos 350
imagebutton auto "maps/arrow_L_%s.png" action [Jump("x23y13z4")] xpos 124 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x22y12z4")] xpos 500 ypos 650
elif (loc1 == "x23y13z4"):
hide SD_E_LAD
hide SD_S_1
show SD_T_2 with ffade
$ loc1 = "x23y12z4"
call screen x23y12z4c
screen x23y12z4c:
imagebutton auto "maps/arrow_L_%s.png" action [Jump("x24y12z4a")] xpos 124 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x23y13z4")] xpos 500 ypos 650
imagebutton auto "maps/arrow_R_%s.png" action [Jump("x22y12z4")] xpos 900 ypos 350
label x22y12z4:
$ p_min +=1
if (p_min > 59):
$ p_min -=60
call time_call_1
if (loc1 == "x23y12z4"):
hide SD_T_3
hide SD_T_1
hide SD_T_2
show SD_S_1 with ffade
$ loc1 = "x22y12z4"
call screen x22y12z4a
screen x22y12z4a:
imagebutton auto "maps/arrow_F_%s.png" action [Jump("x21y12z4")] xpos 500 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x23y12z4")] xpos 500 ypos 650
elif (loc1 == "x21y12z4"):
hide SD_T_3
hide SD_T_1
hide SD_T_2
show SD_S_1 with ffade
$ loc1 = "x22y12z4"
call screen x22y12z4b
screen x22y12z4b:
imagebutton auto "maps/arrow_F_%s.png" action [Jump("x23y12z4")] xpos 500 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x21y12z4")] xpos 500 ypos 650
############# X21 corridor #######
label x21y10z4:
$ p_min +=1
if (p_min > 59):
$ p_min -=60
call time_call_1
if (loc1 == "x21y11z4"):
hide SD_S_1
show SD_B_R with ffade
$ loc1 = "x21y10z4"
call screen x21y10z4
screen x21y10z4:
imagebutton auto "maps/arrow_R_%s.png" action [Jump("x20y10z4")] xpos 900 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x21y11z4")] xpos 500 ypos 650
elif (loc1 == "x20y10z4"):
hide SD_S_1
show SD_B_L with ffade
$ loc1 = "x21y10z4"
call screen x21y10z4a
screen x21y10z4a:
imagebutton auto "maps/arrow_L_%s.png" action [Jump("x21y11z4")] xpos 124 ypos 350
imagebutton auto "maps/arrow_B_%s.png" action [Jump("x20y10z4")] xpos 500 ypos 650
ETC. ETC...