BanksySan's Recent Forum Activity

  • Never do something you think is clever in order to make a random "more random". All Random number generators are designed with a single seed value supplied at initialization (nanoseconds since 1900 for example) and then numbers taken one after another.

    I've had some bonkers bugs because people have generated multiple random number generators.

  • You do not have permission to view this post

  • As above, what does the retro preset do that makes it special compared to the other presets?

    Tagged:

  • I'm trying to think of practical examples of when one of these is correct over the other.

    If this is being used for a physics-type behaviour, and my objects objects are solid then IsOverlapping should never be true.

    If I am mimicking a coin collecting scenario (e.g. Super Mario Bros.), then they should be the same, but if the engine is slow and misses the OnCollision event then I guess it would be possible to be overlapping.

    So...

    Is it fair to say, always use OnOverlapping, as this will not suffer from the case of an OnCollision getting missed?

    If not, could anyone suggest practical examples of when one would be correct and the other incorrect?

    NB: I'm assuming that it is possible for an OnCollision to be missed due the underlying engine's timings. I could be wrong.

    Thanks All.

    Dave

  • (0,2) are 3 frames 0,1,2.

    (0,1) is correct.

    > (0,2) are 3 frames 0,1,2.

    > (0,1) is correct.

    >

    That's what I thought, but the manual says it doesn't include the upper number.

    random(a, b)

    Generate a random float between a and b, including a but not including b.

    So the manual must be wrong.

    do you have more than 3 frames?.. if not, just use choose(0,1).

    This behaviour of random is pretty common across platforms. It would be horrible if random(n,m) could return both n and m as the the space between n + 1 and m - 1 would be different.

  • Have you set animation speed to zero?

    That would explain why it's getting yellow at the start, but never again.

    if the animation got the 3 then stopped, all subsequent changes would be permanent.

    That might also explain why some get there faster then others, if some are set to frame 2.

    A plan is beginning to form. I'll do some tests and post the results up.

  • I have some flashing spots.

    There is an entry in my event sheet setting the animation state to 0 or 1 (green color and red colour). There is a third animation frame, which is yellow.

    The animation fram is set every x seconds with:

    floor(random(0,2))[/code:3lxhpdkz]
    
    However, when the page loads, several of the spots are in animation frame 3 (Yellow).  This is only when the page loads initially.   After a second or two, the fewer yellows are shown and the red and green take over.
    
    [attachment=1:3lxhpdkz][/attachment:3lxhpdkz]
    
    Here is my event sheet:
    
    [attachment=0:3lxhpdkz][/attachment:3lxhpdkz]
  • Cheers Linkman,

    I did a little bit before seeing your post. What I have now is making the isActive random, now however, gradually all the spots get isActive set to true. It takes about ten seconds.

    [attachment=0:4zekdmgz][/attachment:4zekdmgz]

  • I can a set of Spot objects which have a boolean instance variable of isActive.

    [attachment=0:304x8zq5][/attachment:304x8zq5]

    Once a second I want random spots to toggle this state (as opposed to above, where all are toggles every second).

    I've seen the randomnumber(0,1) method, but I can I convert the number into true or false.?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • We don't write code directly, but complex logical structures are there. Events, loops, objects etc. there's even a the concept of a class in there.

    Obviously, I can't easily isolate a class for unit testing, however I might be able to test at a higher level, so has anyone had any success in writing an automated test suite?

    (P.S. I don't think I said TDD replaces manual testing)

  • Hi all,

    Is it possible to write automated tests for Construct 2?

    So far, the only think I can think of is Selenium, but that assumes that elements can be defined in a predictable manner (ids, names, XPath or CSS selectors).

    I'm used to a TDD approach to software, so relying on manually running through the game(s) on any change is a little scary.

    (Partly because I am an awful manual taster)

    Thanks in advance

  • No, I didn't realise it would crop it!

    Thank you.

BanksySan's avatar

BanksySan

Member since 26 Feb, 2015

None one is following BanksySan yet!

Trophy Case

  • 9-Year Club

Progress

9/44
How to earn trophies