Rot (Construct 3 Plugins)

You're viewing a single comment in a conversation. View all the comments

  • Order by
  • Hello piranha305,

    In my project, I loop in every cell to check if the ones next to it are corridors, rooms, etc... so I can set the appropriate sprites.

    But it wasnt working at all, until I saw errors in the console. The conditions "is in Room" and "is in Corridor" throw an error if the cell isnt in the grid (trying to access to the property of undefined object).

    So I fixed it by changing the code (in the example, CellIsRoom) from

    return[x + "," + y].type === "room";


    return[x + "," + y] &&[x + "," + y].type === "room" ? true : false;

    and then pretty much the same thing for others conditons.

    If you're still active, make sure to update it ;)