Every random time change random platform and etc. [Question]

Hello,

I am developing a game where the most essential part of it is the thing I am trying to code.

image

Every random seconds between 5 and 15, change random actor:platform (they are 50) image to another image for 5 seconds. On impact with player (teal) while this image is active, add points.

I have an idea how to implement it, although I think my code suggestion is too complex and may not work.

Have you got any ideas, samples, suggestions?

Thank you in advance

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Timer every random(5,15);
    Timer for 5 seconds change image to: X
    This will select a random time between 5 and 15 seconds and then stick to that value for the whole time the timer runs.

    So if the random selection is 9 seconds, the first cycle of the timer will be 9", the second will be 9", the third will be 9", the fourth will be 9" . . . and so on.

    I think most people employing this method expect it will give them a timer that produces a sequence of random time lengths (4, 7, 7, 2, 14, 9, 3 . . . . that kind of thing) rather than a randomly chosen (but repeating) time length.

    Also, I'm not sure what's going on with this 'change image for 5 seconds' thing ? If the image needs to only be displayed for 5 seconds then you'd need to change it back to something else (the previous image ? Another randomly chosen image ? A blank image ?) after 5 seconds . . . .?
  • BonepileGamesBonepileGames Member Posts: 194
    Also, I'm not sure what's going on with this 'change image for 5 seconds' thing ? If the image needs to only be displayed for 5 seconds then you'd need to change it back to something else (the previous image ? Another randomly chosen image ? A blank image ?) after 5 seconds . . . .?
    Change to previous image.

    The issue is that I want every time random platform to change its image, with different AFTER random seconds.

Sign In or Register to comment.