R0J0hound's Forum Posts

  • That's a fun result:

    https://dl.dropboxusercontent.com/u/542 ... lling.capx

    Multiple circles aren't very considerate sometimes though.

  • Prominent

    That's odd, but I don't think i'll be able to fix it. It appears to be a bug with the library itself.

    When those triggers are called the simulation is in a locked state where only certain things are allowed to happen. To make it work the library delays certain things from being done until the simulation is no longer in a locked state. Also on top of that i've added stuff on top of that. The result is too many cases where things can fail.

    The bug here is with waking up sleeping objects when the library is in a locked state.

    I guess the workaround for this particular case is to either disable sleeping, or keep those objects awake with a "every tick: wake sprite" event.

  • I think by "memory management" it means faster things than garbage collection can be used. Aka less small pauses.

    Actually, it's very similar to asm.js and probably has similar performance characteristics. The main draw over asm.js is the code will be more compact in size, but I'd have to see an example to see by what margin.

    If parts of the engine were re-written to use it I'd imagine it would mainly be the bottleneck areas. I doubt the interface used would change as that would break existing plugins. Also it's just a feature available to the browser so plugins/behaviors can even be made to use it now if the browser supports it. The same can be said for asm.js currently.

  • Prominent

    Assuming the circle can be rotated in 3d you can then think of it as a plane. This link has some useful equations:

    http://paulbourke.net/geometry/pointlineplane/

    Edit:

    1. Just find the intersections between the circle plane and the edges of the polygon. If none intersect it doesn't collide.

    2. With the intersections check their distance from the center to see if they they're within the radius. If any do, it's a collision and you're done.

    3. if none of the intersections are within the radius, and you have two intersections you then find the closest point from the line between the intersections and the center.

  • C3 is an editor re-write and supposedly will make plugins able to have more deluxe editor capabilities. So if that's true even if this isn't officially added, a third party plugin could be made to do it.

    A current idea you could use is to make an in game editor to add the collision maps. Here's a quick mock up:

    https://dl.dropboxusercontent.com/u/542 ... ditor.capx

    There's the initial work of creating the editor mode but afterwards it makes it much quicker than manually positioning lines like that with sprites. Not to mention that you can extend it in any way you need.

  • That's the value in the two fx files. It's the red, green, blue, and alpha amount. All in the range of 0.0 to 1.0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To just change the color used for solid replace the

    vec4(1.0,1.0,1.0,1.0) with any other color.

    The second idea to let multiple colors be solid is unsolved.

  • You can modify the effects to make a different color be immovable. To use any color for solid it would require more creativity with the effect to somehow encode color and whether it's sand or solid in each pixel.

    There isn't a "trail" when I run it so I don't see what is to be removed.

    Also if you search the forum for "falling sand" you should find some examples using an array.

  • tunepunk

    This roughly follows that, except it jitters left and right instead of moving diagonally. Being done in a shader we can't actually move pixels. We can only change them. To do this it detects patterns and changes pixels.

    Doing it with an array can also be done. It looks good but does not scale like the shader can.

    Anyways it may be possible to do diagonal motion instead of horizontal.

    Thelegendvinny

    White doesn't fall which explains why much of the init graphic doesn't fall.

    Things move a pixel at a time so to make it spread faster pixels either need to move further every step or the effect needs to be applied multiple times. You can add a repeat condition to the second event to do the latter.

    I don't understand the second question.

    To fall it spreads out vertically first, which makes it look to fall slow. I see no solution to this if done from an effect, and the web seems to lack examples to this except for one on shader toy. However I lost interest in analyzing how it works and mapping it to what we can do with effects in C2.

    Also I found a way to test it. If I couldn't do that it would be broken in many ways.

  • If it runs and nothing is animated then my only guess is webgl isn't being used. Do other effects work for you?

    If not then your graphics card is probably blacklisted on your browser and you'll need some solution without effects.

  • The example is the physics. The particles move down and shift left and right to settle in heaps instead of tall pixel piles. That is roughly what the particles example you referenced does, except it has more spread.

    Did you have a different kind of physics in mind?

  • Here's the example with two required shaders. It also requires the paster plugin.

    https://dl.dropboxusercontent.com/u/542 ... shader.zip

    black is empty

    white is wall

    everything else is a particle.

    There are probably other ways to improve it, but since it's using webgl I get very low fps.

  • I can't attempt to make an example for a day or so.

    You won't need the canvas plugin, you'll need the "paster" plugin. It's much like the canvas plugin but it can utilize webgl. Notice web browsers used to let my machine use webgl.

    Other than that the rest is just a rough outline.

  • Here's one way:

    Basically you find the distance() and angle() between both objects, then if the distance is greater than the radius you can the set the second object's position to the first and use the "move at angle" action with the angle and radius as parameters. Or some variation of that.

    Here's one possible example in case the above capx doesn't do it as I recall.

    Global number dist=0

    Every tick

    --- set dist to distance(sprite1.x,sprite1.y,sprite2.x,sprite2.y)

    Dist>radius

    --- sprite2: move dist-radius pixels at 180+angle(sprite1.x,sprite1.y,sprite2.x,sprite2.y) degrees

  • Your images aren't working