Random & Spawn

0 favourites
  • 6 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hello!

    <font color=blue>MISSION</font> Spawn a plant from mariobros pipe 40% of times.

    <font color=blue>my logic :</font>

    Pipe: 2 var ( spawn(40) e Random(0) )

    ON CREATED pipe set floor random 100 / set a text print number

        ----> random < spawn : spawn plant /append text GOOD

    <font color=blue>RESULT :</font>

    -random number is generated and printed some times it append multiple times GOOD

    -plant is spawned but not with my criteria, it spawn randomly(i dont know how)

    i've also tried another sub event with the opposite(if greater than) print BAD

    someteime plant is spawned printing both good and bad O_o

    <font color=red>QUESTION</font>: What is wrong with my logic? :) THX in Advance

  • On pipe created

    .. random(100) < pipe.spawn

    ... spawn the plant

    ... print the good text

    .. else

    ... print the bad text

    Should work :)

  • i've not understood the difference :/

  • i've not understood the difference :/

    It's pretty much the same thing with few differences, post your .capx, as the problem is probably somewhere else.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're using floor on create and not on randomizing, maybe is it, I'm not sure if understanded your logic because it's not like it's on the C2 event sheets.

    Do you have any CAPX to share the problem?

  • I've cleaned all,and i dont know why...it works :/   i had no other math,espression script :/ bah I,m sorry for bothering.

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