Random Platform

In my game, platforms are supposed to randomly pop up as the player advances. But I don't know the coding for that.
It's supposed to be programmed so that when the person exits the app, the platforms are never the same.

Comments

  • tintrantintran Member Posts: 453

    create an invisible actor called platform manager or something and have that actor manage (spawning of randomly generated platforms) the platforms.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
  • Ayolabi12345Ayolabi12345 Member Posts: 30

    Okay so I did that. But how do I make a door randomly spawn at random times?

  • tintrantintran Member Posts: 453

    like a door that appears at random time and then disappears?
    maybe add game attribute called last_time, and an attribute called next_time
    then in your invisible manager
    add a these rules
    change attribute next_time = random(1,5) (to make it random from 1 second to 5 seconds)
    if numerical expression
    (self.time - last_time) >= next_time
    do
    - change attribute last_time to self.time
    - change attribute next_time = random(1,5)
    - spawn door

    then in your door actor....
    timer after 1 second
    destroy

    so this will make your door appear randomly between 1 to 5 seconds and disappear after 1 second.

Sign In or Register to comment.