Advice for spawning on different platforms

0 favourites
  • 5 posts
From the Asset Store
This music pack covers differents situations for visual novels, anime games and many more!
  • I created an endless runner, an basically I have platforms that spawn on the right and go to the left, in which a terminator block destroys the platform bullet outside the layout and then respawns it on the other side.

    The platform also has different frames on it to add variety on the platform. so every time the previous platform is destroyed a new platform is created on a different animation frame.

    But what I need help with is spawning. How would i choose a specific frame for my platform then spawn an enemy on it?

    So basically I want something like this:

    *when Platform animation is on frame 3

    *spawn enemy on platform 3

    I saw a pick nth instance but I'm not quite sure how it works. This may sound like a dumb question but what is an instance? Are they refferring to the object as an instance, or instance variable of an object?

    Any help is appreciated

  • I can't understand your question to be honest. try to explain better what are you looking for.

    The instance thing is easy, let's say we have the SpriteX, and we spawn it multiple times. The first that you spawned will be the 1st instance, the second will be the second instance, is like an array of objects.

    array = {'Peter','Ann','Josh'}

    Peter is the first instance, Ann the second, Josh the tird.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh I see, thanks for the explanation.

    I want every 3rd instance of my platform sprite to spawn an enemy on top of it. But the thing is onces the character gets past three platforms, three 3 new instances of the same objects apear, and the last 3 are destroyed. If that makes sense. I can expand on this more if your still confused

    But first, what happens to the instance object once its destroyed? Is the next object of that same spot assigned the same instance? By that I mean when the three previous objects are destroyed will the new objects just replace the previous ones as 1,2,3, or does it continue from the previous instance and count the newly created object as a new instance? such as 4,5,6

    For example:

    Let says I spawn 3 bullet objects.

    Im assuming there assigned as instances 1 to 3.

    But when all three of them are destroyed, will the next 3 spawned bullet objects of the same type become instances 1 to 3? or will it continue past 3 and become 4, 5 and 6?

    Im sorry if its confusing I'm still new to construct 2, but I appreciate the help, I can clear up other parts if its still confusing

    I can't understand your question to be honest. try to explain better what are you looking for.

    The instance thing is easy, let's say we have the SpriteX, and we spawn it multiple times. The first that you spawned will be the 1st instance, the second will be the second instance, is like an array of objects.

    array = {'Peter','Ann','Josh'}

    Peter is the first instance, Ann the second, Josh the tird.

  • You could add 1 to a variable every time you spawn a platform and when the variable is a multiple of 3 (variable % 3 = 0) you spawn an enemy.

  • I'll try this out, thanks

    You could add 1 to a variable every time you spawn a platform and when the variable is a multiple of 3 (variable % 3 = 0) you spawn an enemy.

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