I watched Dan Cox on youtube on how to create a Dungeon Crawler and copied his code from the link he provided but it doesn't work..first the (array: code was red but I found out that I have to only write (a:
Every link gives me an error even though I triple checked it..I couldn't have made an error because I copied it and didn't change anything
|map>[(display: "Map")]
|=
(link-repeat: "Up")[{
(set: _row to $dungeon's ($positionX) )
(if: _row's ($positionY - 1) is not 1)[
(set: $positionY to it - 1)
]
(replace: ?map)[(display: "Map")]
}]
this is the code for the passage "Start"
=|=
(link-repeat: "Left")[{
(set: _row to $dungeon's ($positionX) )
(if: _row's ($positionX - 1) is not 1)[
(set: $positionX to it - 1)
]
(replace: ?map)[(display: "Map")]
}]
=|=
(link-repeat: "Right")[{
(set: _row to $dungeon's ($positionX) )
(if: _row's ($positionX + 1) is not 1)[
(set: $positionX to it + 1)
]
(replace: ?map)[(display: "Map")]
}]
=|=
(link-repeat: "Down")[{
(set: _row to $dungeon's ($positionX) )
(if: _row's ($positionY + 1) is not 1)[
(set: $positionY to it + 1)
]
(replace: ?map)[(display: "Map")]
}]
|==|
this is the code for passage "Map"
{
(set: $dungeonTable to "<table>")
(set: $i to 0)
(for: each _row, ...$dungeon) [
(set: $i to it + 1)
(set: $dungeonTable to it + "<tr>")
(set: $j to 0)
(for: each _col, ..._row) [
(set: $j to it + 1)
(if: $i is $positionY and $j is $positionX)[
(set: $dungeonTable to it + "<td>P</td>")
]
(else:) [
(if: _col is 0) [
(set: $dungeonTable to it + "<td>.</td>")
]
]
(if: _col is 1)[
(set: $dungeonTable to it + "<td>#</td>")
]
]
(set: $dungeonTable to it + "</tr>")
]
(set: $dungeonTable to it + "</table>")
$dungeonTable
}
and finally the passage "Startup"
{
(set: $dungeon to (a: (a: 1,1,1,1,1),
(a: 1,0,0,0,1),
(a: 1,0,0,0,1),
(a: 1,0,0,0,1),
(a: 1,1,1,1,1) ) )
(set: $positionX to 2)
(set: $positionY to 2)
}
Please help