How do I 'click' objects together after spawning?

0 favourites
  • 5 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hiya guys,

    I'm trying to figure out how to randomly create scenery (houses) and click them together the moment they spawn. I've used code to do this but I want to demonstrate to users that this can be done entirely with drag and drop commands (using a spawn point or something similar). Here's the situation in a nutshell:

    • Objects now appear with random intervals (every X seconds) and random appearance (from a pool of frames within the sprite). This makes it seem different houses are on the background all the time. Neat, but it could be better. I want the houses to be connected, forming a skyline. Two image points should do the job, i.e. clicking origin 0 of one object to origin 1 of the other.
    • I am using a spawn point outside of the layout and have already tried to use two sprites that spawn each other in turn, which works yet feels like a lengthy ordeal (I did the same thing for wrapping a background, using two instances of the same object).
    • I'd like to do this without code, as I am using it for educational purposes. The frames I'm using within the sprite are all different sizes, so connecting them with a ticker counting pixels is not an option.

    Any tips?

  • Hiya guys,

    how to randomly create scenery (houses) and click them together the moment they spawn.

    Any tips?

    Iam still cant figure out what it mean..

    sorry, because of lack of understanding.. :(

    btw, can u bring sample capx here?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No sample capx yet, all theory for now. Imagine a sprite with ten frames (different houses). A spawn point outside of the screen sends it in, with bullet behavior and an angle set at 180 degrees. Say every three seconds, a new house spawns outside of the screen, with a certain distance. I'd like to remove that distance and have these sprites neatly 'click' together, like LEGO bricks.

  • If you go ahead with the method using the bullet behavior, you would simply have to stop the object once it collides with another house

    so. each house would have a bullet behavior facing 180

    house on collision with house -> set bullet speed to 0

    as each house touches the one before it, it will stop sliding in.

  • why not set the origin on the left and add an imagepoint on the right and have sprite itself spawn the new sprite at imagepoint 1, then set the frame to random.

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