Hi
I'm trying to create a simple map in Twine 2 Harlowe, however I am having difficulty (because i'm not very good at this). I'm trying to use (altering) Dan Cox method from Sugarcube to no avail. This is what i've done, trying different syntax.
Map system
(display: "Location")
(if: $mapArray($positionY-1 and $positionX) is 1)[
North]
(else-if: $mapArray[$positionY][$positionX+1] is 1)[
East]
(else-if: $mapArray(($positionY+1)($positionX)) = 1)[
South]
(else-if: $mapArray(($positionY)($positionX-1) = 1))[
West]
My array comes from here:
(set: $maparray to (array:
(0,0,0,0,0),
(0,1,1,0,0),
(0,1,0,1,0),
(0,0,1,1,0),
(0,1,1,2,0)))
(set: $positionX to 1)
(set: $positionY to 1)
Thoughts?
Comments
The following is a corrected version of your example, with shorten variable names. note: One difference between the arrays used in SugarCube and those used in Harlowe is that in SC the first element in an array has an index of zero (0), where as in H the first element has an index of one (1).
;-) Thanks for the quick reply.