R0J0hound's Forum Posts

  • I'd recommend looking at Ashley's blog for lots of info about C2's performance and what affects it.

    https://www.scirra.com/blog/ashley/21/u ... asurements

    I can't run your projects right now, however...

    Behaviors do use performance but it varies per behavior. Also to have a fair comparison between events and a behavior they should give you the same results. But yeah, if you're doing something simpler than the behavior you can do it with events and be faster in cases. The reverse can be true as well. I did some complex isometric sorting with events, then made a behavior to do the same thing and got a performance increase.

  • It's an interesting problem. You'll have to use a force for the air friction. The basic formula for that is:

    Friction force=-velocty*b

    Where b is the strength of the friction.

    The amount of air friction (or drag) would vary according to the angle of the frisbe relative to it's direction of motion. The force would be greater when the frisbe is perpendicular than when it's parallel to the motion.

    So we could write it like this:

    Drag=-velocty*b*sin(anglediff(frisbe.angle, frisbe.angleOfMotion))

    Well, actually if we want to use the apply force at angle action we can do this:

    Angle: 180+angle(0,0,frisbe.physics.veloctyx,frisbe.physics.velocityy)

    Force: b*sin(anglediff(frisbe.angle, angle(0,0,frisbe.physics.veloctyx,frisbe.physics.velocityy)))*distance(0,0,frisbe.physics.veloctyx,frisbe.physics.velocityy)

    Also I did something similar before with falling leaves which you can find with a forum search. It could be useful.

    That still probably won't like a frisbe would move so maybe you could simulate the gyro effect of spinning objects be using a variable to specify the spinning speed of the frisbe and make it harder to tumble when it's spinning. Another is modeling a better physical shape for the drag, since with the above it would be treated as a flat disc.

    Anyways that's just some ideas of the stuff you could do. You maybe could even do something simpilar that looks better.

  • You can't do that in construct, since it runs with html5/javascript and it would be a security violation to let stuff that runs on a webpage simulate keystrokes as if the user pressed it.

    To do it you'd have to use something much lower level that has access to the winapi, and even then simulating a keystroke in another program is kind of hacky.

  • [quote:2sz57ylx]So how do you do it then?

    You could add 1 to Play_time instead of 0.1 and whenever you want to look at the value divide by 10.

  • tulamide

    Someone made a plugin here:

    But I don't know if it has the level of features you're looking for.

  • I was referencing event numbers in the last capx you posted. To fix it, add a "pick all spite" condition above the "for destroy" loop in the same block.

    Before that fix or even phimaka's function solution, the loop did run, only it wouldn't destroy any other sprites other than the rightmost one because it was the only one that was picked before the "destroy" loop.

  • Does the microsoft browser work?

    Besides addons you'll have to look in your browser's settings to see if javascript is disabled. By default it wouldn't be disabled, so presumably your friend disabled it, or some antivirus/security software he uses disabled it.

    As an example for chrome I found it under settings->advanced settings->context settings...

    In the javascript section there are settings to disable it completely or block or allow certain sites.

  • It's not a bug it's the way picking works.

    Event 4 picks only the sprite overlapping the Scan object, so in the sub event 7 you'll only be checking for an overlap with that sprite. If you want to check for overlaps with all the sprites then functions work since what's picked isn't passed to the function. Another idea would be to use the "pick all" condition.

  • You could use a regex search i suppose. Find in C2 uses a regex.

    You could also use the javascript "indexOf" to do it. It's case sensitive.

    global text variable="Aa"

    start of layout

    Text: set text to Browser.execJS("'"&variable&"'.indexOf('a')")

  • tulamide

    Hey that sounds pretty cool.

    megatronx

    I guess he could by generating it on the fly with webauido, but from the sounds of it he's using something else to program directly with a dsp chip on the soundcard.

  • socialpilgrim

    For everything except paste the coordinates to draw at are relative to a unrotated canvas.

    To have the point be the right spot you could use this equation to rotate around the canvas' center by the canvas' angle:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you mean properties for your plugin you can specify the type as integer or float:

    https://www.scirra.com/manual/20/properties

    Otherwise all numbers in javascript are double.

  • I can't open your link. Put spaces in the url or put it in

     tags.
    
    Usually typical random is too noisy to be smooth.  Using perlin noise is one option to have smooth noise.  Another is to generate the noise at a lower resolution and interpolate to a higher resolution.
    
    Squidster's go faster uses the second idea.
    
    For the first you could look here:
    
    It uses the noisejs plugin
  • Presumably you can access and change the collision polygon at runtime with the sdk. Yann's "polygon" plugin changes the collision polygon as I recall. You could reference that for an example.

  • Not really enough details to say why it wouldn't work. Assuming the sprite is in the family like you say and it has that boolean set, it should work.

    That said it may not be pickable yet if it was just created and a toplevel event wasn't reached yet. Is it a sub-event of something?