User Tag List

Results 1 to 4 of 4

Thread: Random object creation not working properly on Android

  1. #1
    No Products Registered

    Join Date
    Nov 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Random object creation not working properly on Android

    Hi everyone!

    I hope I'm writing this in the right section. I'm quite new to clickteam and I have run into an issue that I don't know how to solve or what causes it.

    In short. I'm making a simple side scrolling jumper game. I made so that there are different objects which are created randomly outside of the screen and then come in with a set speed.

    - I set up different event groups beacuse as the game progresses the speed of objects is set faster and I want to deactivate the the ones which are not used at the moment.
    - Only the current speeds group is active at the time of running. When the player get a certain amount of points the first random generator group is deactivated and the second one with higher speed values is activated.
    - The objects are created in these event groups and are destroyed when they get too far from the frame on the other side.

    So it runs like this:
    - The program checks the randomObject Global value if it is 0
    - It is set that it runs every 3 second so it creates obstacles every 3 seconds (with higher speed it generates faster)
    - it only happens if the player score is below a certain number.
    - I set it so it runs once per loop
    (If the above are all true)
    -- Set randomObject value to random(0,1)
    -- Create object at set coordinates
    -- Set speed of object

    the second event in the event group looks similar:
    - The program checks the randomObject Global value if it is 1
    - It is set that it runs every 3 second so it creates obstacles every 3 seconds (with higher speed it generates faster)
    - it only happens if the player score is below a certain number.
    - I set it so it runs once per loop
    (If the above are all true)
    -- Set randomObject value to random(0,1)
    -- Create object at set coordinates
    -- Set speed of object


    Now this works perfectly with windwos exe, however on android sometimes it creates 2 objects at the same time (so basically it runs the globalValue 0 and globalValue 1 events at the same time)

    Is there something different in how windwos and adndroid deals with the global values? How can I work around this problem?

    Hope someone can help me in this And sorry if this a noobis question or if it has already been answered somewhere.

  2. #2
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    If you're using the built-in timer, ditch it. Create your own timer based on true frame ticks. So you would create a global value called 'delta', Always: Add 1 to Delta. If your game runs at 60fps and you want an update every 3 seconds, then when Global Value Delta => 180: Set Global Value Delta to 0. This will add 60 every second, so 180 would equal 3 seconds.

    So rather than the condition being "Every 3 seconds" it would now be "Global Value Delta = 0", or you can MOD if you need to tailor it more.

  3. #3
    No Products Registered

    Join Date
    Nov 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, I will try it when I get home and post how it worked out.

  4. #4
    No Products Registered

    Join Date
    Nov 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok it fixed the problem. Thank you again for the quick help

Similar Threads

  1. riding a car, ain't working properly
    By Perry in forum Fusion 2.5
    Replies: 0
    Last Post: 26th September 2014, 06:16 AM
  2. MMF2 - Random Object Creation and Left Mouse Click Question/Issues.
    By peejaygee in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 31st December 2013, 12:32 AM
  3. Random object creation
    By mr_mercury06uk in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th April 2013, 08:43 PM
  4. Trial Object - Reset not working properly?
    By aidmm in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th March 2007, 08:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •