Spawn object without spacing?

0 favourites
  • 6 posts
From the Asset Store
Spaces Ambience contains 102 Sounds: 53 track and 49 sounds
  • Happy new year everyone.

    Layout size 720 x 1280

    Grid size 144x144

    5 sprites 144x144 in each row.

    Im trying to spawn unlimited sprites from up and moving down.

    All my attempts leave some space between the sprites at high speed.

    So Im looking for the best way.

  • Not sure I understand, but are you actually getting your objects to spawn? If so, you could try giving them the bullet behavior and then set angle of motion to random(90,270) This being up and down in degrees. Type in the word random with numbers in parentheses as shown in sentence before.

  • My problem is with spawn part.

    On start of layout i spawn 5 sprites at -144 Y and X 0 144 288 etc.

    When this sprites Y is greater than 0 i spawn another 5 sprites at 0 Y but it seems that some of New sprites leave a small spacing for the older sprites while they moving down.

  • the problem is the greater than 0 part. As the objects speed up, they will move more than a whole pixel each tick. So when the spawn code gets triggered the previous objects are further down the screen than what you want.

    Instead of spawning the new objects at -144, you should spawn them at the Y value of the previous row minus 144. that will leave no gap.

  • I think the best way is to use System - For loops (use two fors, name them for example "x" and "y").

    For "x" from 1 to 5 create sprite at loopindex("x") * sprite.width

    For "y" from 1 to something create sprite at loopindex("y") * sprite.height

    idk, something like that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you guys...

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