How to Have a Random Time?

Eri3henEri3hen Member Posts: 1
edited April 2014 in Working with GS (Mac)

I'm making a sort of "Whack-a-Mole"-like game and I'm trying to have the moles disappear for a random time period (between 2 and 4 seconds). How do I do that? I know how to make the mole disappear but how do I make a random spawning time period?

Comments

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375

    Every random(2,4) seconds spawn

  • ArmellineArmelline Member, PRO Posts: 5,458

    @tatiang recently posted just this in the Spare Code Thread.

  • Eri3henEri3hen Member Posts: 1

    yeah I have that already but it still won't work. I also have a real attribute RandomTime to 1.
    Here's what I have:

    rule when all is pressed : touch
    interpolate alpha 0
    timer every 1 second(run to completion) set self.RandomTime(2,4)

    timer every 2 second
    if self.randomtime 2
    if self.randomtime 3
    if self.randomtime 4
    interpolate alpha 1

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2014

    You posted this in Help Wanted which is for PAID requests. I moved this to Working with GS. If you're using Windows, let me know and I'll put this thread in the PC sub-forum.

    Are you sure you tried my demo? It sounds like you're making things more complicated than they need to be. Here's the direct link to the post: http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547.

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2014

    'How to Have a Random Time?'

    Drink heavily on an empty stomach.

Sign In or Register to comment.