GameSalad

need help generating specific random positions

pranshudhungana21pranshudhungana21 Posts: 20Member, PRO
edited August 2016 in Help Wanted

So in my game i have two actors who are obstacles once they are together. They are 2 spikes and i have 3 different ways in which the spikes could be laid out, as this a endless runner, i had difficulty in trying to find a way to randomise the 3 different way the spike could be laid out. I tried using the rng but because it can only randomize 2 way in which it could be laid out . its hard. Could anybody help with this problem?

Comments

  • NNterprisesNNterprises Posts: 387Member, PRO

    Create an integer attribute called RANDOM

    TIMER:
    Every .1 seconds, change RANDOM to random(1,3)

    RULE:
    If RANDOM = 3, spawn spike1 on top or whatever
    ELSE - if RANDOM = 2, spawn spike2 in middle or whatever
    ELSEELSE- if RANDOM = 1, spawn spike3 on bottom or whatever

  • SocksSocks London, UK.Posts: 12,821Member
    edited August 2016

    //

  • NNterprisesNNterprises Posts: 387Member, PRO

    @Socks is always topping me

  • SocksSocks London, UK.Posts: 12,821Member
    edited August 2016

    //

  • NNterprisesNNterprises Posts: 387Member, PRO

    lol your good @Socks . No need to go into hiding

  • pranshudhungana21pranshudhungana21 Posts: 20Member, PRO

    thanks so much

Sign In or Register to comment.