Two simple questions (about automatic object creation)

0 favourites
  • 7 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hi, I have two questions to ask:

    1) How can I simply create a variable number of the same object (using random) in a certain space of the layout?

    I tried to create a variable and an event that at the start of the game gives the variable a random number like 1 - 5, and another event that says "Var greather or equal 0 -> create object" and "add to Var - 1 "Thinking he would repeat the action several times, but it didn't work at all.

    2) I would like to create a game like "find hidden objects", how can I always place objects half at the edges of other objects and half behind? (Considering that the objects that have to be on top could be some and of different shape) I could just do it in the layout, placing object by object, but it would take too long, I would like to insert planets or other things and insert small UFOs behind them, but all variable and so that the system does everything by itself

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No idea why you are comparing layout name

    For first question

    Repeat 10 times (you can replace 10 with a variable)(repeat is a condition)

    Create object.....(same thing which you have wrote). And delete "add" command. It is now not needed

  • Second question

    When you create objects,they are made in that order (provided if you use same layer)

    So if you create a pot first and then flower then flower will be over pot

  • I compared the layout name because if not create objects on all layouts, maybe there is an easier way, anyway thanks.

  • Second question

    When you create objects,they are made in that order (provided if you use same layer)

    So if you create a pot first and then flower then flower will be over pot

    however I should make sure that the objects are always at the edge of the upper object, that is, if the planet is there, the UFO should be under the planet, but half at the edge and half visible. Also I might want to put a non-round object in place of the planet

  • > Second question

    > When you create objects,they are made in that order (provided if you use same layer)

    > So if you create a pot first and then flower then flower will be over pot

    however I should make sure that the objects are always at the edge of the upper object, that is, if the planet is there, the UFO should be under the planet, but half at the edge and half visible. Also I might want to put a non-round object in place of the planet

    first create ufo,then planet,then any thing over planet

  • Download example

    in this example you have... 2 rows, 10 coins, 8 coins on the first row 2 coins on the 2nd row...

    they are evenly spaced out, you can control the values etc...

    you can also place a random position on screen using loopindex.. however if objects overlap, you have to add a "condition" to move the top object a bit to left or right until is not overlapping.

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