Issue on Spawn Object's Imagepoint

0 favourites
  • 5 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • I have 10 imagepoints on the enemy (not including origin point) and I want to spawn a spark on a random imagepoint number from 1-10

    So I use an event like this

    Enemy on collision with player

    For Each Enemy

    -> Enemy spawns spark at layer 0 at imagepoint choose(1,2,3,4,5,6,7,8,9,10)

    but it spawns 10 sparks at the same time

    I tried this

    -> Enemy spawns spark at layer 0 at imagepoint floor(random(10))+1

    but it spawns 10 sparks the same.

    Is it not possible to use expressions (system expressions, that is) for imagepoint?

  • Have you tried adding the "trigger once while true" condition after yours?

    For example:

    (enemy.X > 10 && Trigger once while true) ->Enemy spawns spark at layer 0 at imagepoint choose(1,2,3,4,5,6,7,8,9,10)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't use "trigger once while true" because on collision is a trigger condition.

    I did try "trigger once while true" as a sub-event condition. I don't know why it still spawns 10 spark objects.

    I also tried adding (3rd level) sub-events under "trigger once while true" event like these:

    choose(1,2,3,4,5,6,7,8,9,10) = 1

    --> spawn at imagepoint 1

    choose(1,2,3,4,5,6,7,8,9,10) = 2

    --> spawn at imagepoint 2

    and so on

    still spawning 10 sparks

  • You yourself mention having a "For each enemy" - this shouldn't be needed as on collision they are already picked. Also I'd use random(1,10) for the imagepoint choice.

  • you could do it like so

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