Randomly pick 1/3 box sprites as a trigger

0 favourites
  • 2 posts
From the Asset Store
Over 2700 files with all the colour combinations from a 15 colours palette!
  • I have 3 sprites at start of layout - called 'box' - 32x32 in size.

    system = create object box on layout 0 at (16,17)

    system = create object box on layout 0 at (box+32,17)

    system = create object box on layout 0 at (box+32,17)

    I'm trying to randomly nominate 1 of 3 boxes to be a trap door. so if 'platform' player collides, the trigger will spring.

    I've tried 'Pick a random box instance' with another object, but it just ain't working out.

    poor example - sorry

    ____ ____ ____

    | | | | |x |

    ----- ------- ------

    Does this make sense?

    I'd appreciate all the help I can get.

    Roberto

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • something like this some work.

    system = create object box on layout 0 at (16,17), set instance variable = 1

    system = create object box on layout 0 at (box+32,17), set instance variable = 2

    system = create object box on layout 0 at (box+32,17), set instance variable = 3

    on start of layout(or whatever) >>> set global variable to floor(random(1,4))

    then system pick by comparison to select the block that has the same instance variable as the random global.

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