BanksySan's Forum Posts

  • I've got some stray instances of sprites on the layout. I can see them in the Find all references window, but when I right-click and select Go to it just takes me to the entry for the object type. I don't want to delete the type, just the instances.

    How do I delete all the instances without deleting the object type?

  • I'm trying to create an animation to explain the TCP 3-way handshake with Packet sprites travelling between two servers.

    I have two instances of a sprite called Server.

    They have instance variables Name which is set to "Alice" for one and "Bob" for the other.

    I need to generate a Packet sprite at the Alice that travels to the Bob server.

    How do I reference a specific instance in order to get its coordinates?

    Tagged:

  • You do not have permission to view this post

  • What's the small marker way off to the side of the sprite here?

    Tagged:

  • That's what I thought.

    If I check the Optimise for Pixel Art check box then I assume that expanding from a small resolution to a l60'' HD display would be fine, the boxes will be bigger but will remain crisp.

  • nepO

    The quality of Math.random() is definitely lower quality than a crypto PRNG. Over many iterations you'll be able to spot that certain values are more likely than others. A perfect RNG would have equal chance of any number being generated.

    That being said, both are easily random enough for emulating some dice rolls (unless you're emulating trillions of dice rolls).

  • 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]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.?