I want to begin making a maze for my game but I have some problems

1 favourites
  • 4 posts
From the Asset Store
Ball maze is a mobile game, where you have to win the maze.
  • At the current state of my test, each cell of the array is hidden. When the player goes inside a cell, it is revealed, alongside its properties. Each cell currently has 4 important values, one for its top, bottom, left and right. Depending on the number of the value the Cell will either display a door, a wall, or nothing (there can be 1 way doors this way if lets say the first Cell was a door on its right and the second has a wall on its left). The Game properly makes the Cell visible but for some reason it fails to properly load the cell properties, like sometimes I may walk randomly and some properties (which are not correct) will spawn on blocks far away from me, or end up not spawning at all.

    I will unfortunately provide a discord link for my file

    cdn.discordapp.com/attachments/960278860161765436/1329976488862416969/maze_test.c3p

    could anyone perhaps take a look and tell me what I am doing wrong?

    (do not ask why I can move through walls because this is a very very early test)

    I am also planning to add another value that will be responsible for a different maze layout each time it changes

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't understand the purpose of the array. Your array is empty and you don't fill it with any values!

    To fix the bug, add "For each maptile" in event 32

    + maptile: Is discovered
    + System: For each maptile
    + maptile2: id = maptile.id
    + maptile3: id = maptile.id
    + maptile4: id = maptile.id
    + maptile5: id = maptile.id
    

    Also, instead of linking by id, use the hierarchy feature, it will make things easier. And families.

    Player movement events are also very inefficient. Instead of re-calculating the id on every step, simply check which tile the player is overlapping.

  • The bug did got fixed, I am not very experienced with construct3 when it comes to arrays so forgive me

    You are telling me I can do this without using an array? I'd like to know how, since this is a very early design and I will probably redo everything.

    I will eventually add another value that determines the room, so if I change room the entire maze changes layout and gets undiscovered, if I return to the previous room the game will remember whatbwas discovered

    From the thought of this in the end I may need to use an array for this. And for such array I will make an array file now that I learned more about them

  • You are not storing anything in the array, you are basically only using it to count from 0 to 5. You can do the same with two nested "for" loops:

    For "x" from 0 to 5
    For "y" from 0 to 5
    .. Create maptile at (loopindex("x")*maptile.Width)+100, loopindex("y")*maptile.Width)+100)
    

    Or simply place all maptiles manually in the editor and iterate them with "System for each" loop.

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