Checking if Function.Param is the start/end of an Array

0 favourites
  • 3 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I'm trying to create a Random Dungeon, and I'm failing at the first step.

    I've got an array that represents the Dungeon and the cells are the Rooms. When I place a Room, I check to see if I should put an exit in that direction (the value of the adjacent cell is 0 and we aren't at the start/finish of the row/column). If the conditions are met, I modify the Room value at bit level so that the room has an exit on that direction.

    I think I'm doing it right, but I'm clearly not. I've tryed introducing some values at hand on the array and calling the function to check the surrounded cells, and if the start/finish conditions are commented, it works.

    The .capx is commented and the names are self explatanatory. I'd appreciate if someone could check the .capx and let me know what I'm doing wrong.

    Thanks in advance.

  • In the 'Function: Compare parameter' condition you just need to use the index of the parameter (0 or 1) and not 'Function.Param(0)'.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, I knew it was going to be some stupid mistake.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)