Rot (Construct 3 Plugins)

  • 21
    This content is deleted
    Addon
    Rot

    Implementation of ROT.JS (Roguelike Toolkit) for C3Runtime.

You're viewing a single comment in a conversation. View all the comments
  • 1 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 this.map[x + "," + y].type === "room";

    to

    return this.map[x + "," + y] && this.map[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 ;)