AM2000's Recent Forum Activity

  • I'm making an infinite scroll type game using tiled background. The tiled background goes up when the player is going up and down when player is going down and remains static when the player is not moving. So how can I spawn sprites (not in static way) when either the player is going up or down through the tiled background?

  • I have a grid and want to spawn sprites randomly and are not overlapping each other. But once in a while, one, two or even three sprites overlap even though I destroy the sprite they are spawning on. Any advise?

    Trigger Once

    pick a random instance of SP1 &

    SP2Family is not overlapping on SP1 : spawn SP2(turn left) on SP1

    : destroy SP1

    Repeat 2 times

    pick a random instance of SP1 &

    SP2Family is not overlapping on SP1 :spawn SP2(circle) on SP1

    : destroy SP1

  • Okay, thank so much!! Also, just asking, it is better to leave the layout empty and create every stuff in the ES or lays sprites on the layout and set accordingly?

  • 2nd option but in a opposite way. 5 instances of the sprite in locked location and rest 2 sprites instances placed randomly. Is it possible without using arrays?

  • I'm using the arrays because I need to randomise the locations of those sprites which are not in 2nd array. 2nd array sprites just need to be in the static location in the 4x4 grid, other sprites need to be randomly placed.

    Any way to randomly create the sprites without using an array but with that 4x4 grid? Also, if the comparison is false, how can I spawn other sprites.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One thing more, I need to create the remaining sprites which is not equal to the 2nd array elements. Basically, it should be like, if SpriteA compare Variable != array2.CurValue: create spriteC on SpriteA where X = SpriteA(loopindex).X, Y = SpriteA(loopindex).Y

    But it is spawning 315 spriteC everywhere, so instead of that, I wrote.

    X = (SpriteA(loopindex) <> array2.CurValue)).X

    Y = (SpriteA(loopindex) <> array2.CurValue)).Y

    and that is still creating 315 spriteC but now on only one correct location.

    Need to create the spriteC on remaining spriteA. Should I set up the spawners on the layout screen?

    Help would be appreciated!!

  • Many thanks, it worked!! I thought that running the entire stuff on start of the layout may be better than bringing stuff on the layout itself.

  • Also, if the comparison is true, coordinates from 1st array will be used to create the sprite.

  • I've made 2 arrays, one stores the coordinates of all the sprites contained in the grid(so 16 coordinates stored). Other one contains the IID's of those sprites on which certain sprites need to be created(Those sprites have different behaviours). Also, if the array's element(2nd array) is equal to the instance variable(note that the instance variable is different for every instance of the same sprite), that certain sprite will be created. So I need to iterate through the 2nd array and instance vars of the sprites to made the comparison. I'm using for each but I'm getting the infinite loops.

  • There is a grid of 4x4 and I've set the instance variables to the IID's. Like 1st sprite IID is equal to the instance var of the same sprite(1st sprite IID(0) = instance variable(0), 13th sprite IID(13) = instance variable(13). And there's an array having elements, so if the instance variable is equal to the array's element, a sprite will be created.

    So, how can I iterate through the instances and what should I compare them with?

    Help would be highly appreciated!!

  • Thanks!!!

  • So I've got 2 arrays, one is storing all of the coordinates and the other one is storing IID's of all sprites(it is a 4x4 sprites grid). How can I match the index of the first array to the IID's stored in the second. Also, how can I create the sprite if the conditions meet as the create option requires the X and Y axes and I need to create the sprites if the index and the IID are equal(index and co-ordinates are stored in the 1st array)? Like if the condition matches, the sprite will be spawned on the co-ordinates

    Tagged:

AM2000's avatar

AM2000

Member since 5 Dec, 2023

None one is following AM2000 yet!

Trophy Case

  • 1-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

3/44
How to earn trophies