How do I check before create a object?

0 favourites
  • 4 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • hello everyone.. nice to meet you all

    I am a newbie here and still try the trial version of construct. I am usually using game maker.

    I am sorry if question is already posted here. I've already search and can't find the right answer for me.

    I build a simple maze and create a layout 1600x900 pixel.

    I have sprite call "walk" with 25x25 pixel.

    I create a randomize function to create path in the layout.

    Everytime my random get a position, I create object "walk" to mark that position.

    After that, I want to fill the empty position with sprite/object "wall". But how do I check if that position is empty or already have sprite/object "walk"?

    I create

    for "xx" from 0 to wwall > create object "wall" on layer 0 (xx,yy)

    for "yy" from 0 to hwall

    .......................

    but i don't know what to fill the "...." to create a condition if that position xx and yy is empty (no sprite/objct "walk") or already have sprite/object "walk" before create a "wall" sprite/object.

    Can anyone tell me how to do that?

  • Area generator? Sounds like 4 direction square checking empty space. Let's took your time to see this simple room generator:

    dropbox.com/s/baxbebqprpsp64r/generate_tile.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you for your example...

    ...and yes, I have tried your method too... but still, it spawn to the whole screen and cover even the path, not just empty area..

    i don't know why...

    if you don't mind, you can cek my trial maze. I know is a mess...

    1drv.ms/u/s!AlM-dC9w6IDgnXdZsWagmVkP1hTS

  • thank you for your example...

    ...and yes, I have tried your method too... but still, it spawn to the whole screen and cover even the path, not just empty area..

    i don't know why...

    if you don't mind, you can cek my trial maze. I know is a mess...

    https://1drv.ms/u/s!AlM-dC9w6IDgnXdZsWagmVkP1hTS?e=3I1Q2C

    found the problem!!.... i set off the collision, so it won't detect the "if collision".. silly me...

    thank you for your help

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