R0J0hound's Forum Posts

  • Try the Mouse.X("Layer") and Mouse.Y("Layer") expressions with the same layer the minimap is on or just a layer that doesn't scroll.

    https://www.scirra.com/manual/114/mouse

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So in the picture which is the object to push and which is the explosion? Normally an explosion is round so the angle to push the object would be angle(explosion.x, explosion.y, obj.x, obj.y).

    It's possible to calculate the point of collision between a circle and a box but it's not really trivial. In your picture at least the angle from 1 to 2 is not much different than 1 to 3. I guess I'm not fully understanding the issue. Could you post a capx perhaps?

  • Probably use Mouse.X instead of Mouse.AbsoluteX and the same for Y.

  • I'm not sure what line you mean by the other one. Do you mean point 1 to point 3?

    It looks like you can get point 3 with (x2, y2+radius) if that helps.

  • It doesn't work due to picking.

    https://www.scirra.com/manual/75/how-events-work

    A loop can help to make it works like so:

    for "" from 1 to 4

    -- colision detector is overlapping fog at offset (32*loopindex, 0)

    ---- set fog booleans...

    -- [inverted] colision detector is overlapping fog at offset (32*loopindex, 0)

    ---- system: stop loop

  • There is a "set stepping iterations" action of the physics behavior that you could try to fiddle with to reduce the accuracy but increase the speed of the physics simulation.

  • tgeorgemihai

    Paster is faster than Canvas when using webgl, and yes it should be possible to use Paster in the same way as Canvas in that example.

  • No, it just means it works with webgl as previously it didn't. Internally it still uses a standard canvas and copy's to a webgl texture whenever it's changed. Paster should be faster with webgl since it doesn't do any image copying. Also if webgl is turned off speeds will be about the same.

  • Do a search for "falling sand", there are a few topics on it and i believe I've made a capx example of it. The physics is even simpler than verlet, for instance to fall each particle just checks if the space below it is free before moving one space down.

    That being said, it's going to be rather slow unless done with the you with shaders like qwazi's cc example. The paster object could help since you can paste objects with effects applied. But there's likely other details to deal with.

  • This book here has a chapter on it that explains it pretty well as I recall.

    http://www.drdobbs.com/parallel/graphic ... /184404919

    The idea basically is to find a y position for each x position. It can be done with the equation of a line.

    Y=m*x+b

    Bresenham's algo differs in that it does it with no divisions among other things.

    I haven't looked at it in a while but the implementation details are a big part of it.

  • I don't know what you've tried but for a text file you'd "request project file" with AJAX and then use "write file" "on completed". But it doesn't work with binary files like png's for instance.

    A png file can be saved but it won't open as a png file. I looked in the contents of the saved file and by comparing it with the original png file it appears to be encoded as a different codepage since it's being treated as text. So in short "invoke download" is the only built in option to get a png project file to save to the hard drive. Although presumably there may be some unexposed node-webkit function that works with binary files.

  • I think the expression you wanted to do was:

    atan(velY/velX) = a

    But it will have issues with pos/neg in some quadrants, but fortunately you can just do this:

    angle(0,0,velX,velY)

  • Ah, I see the issue, Particles and probably shadows aren't drawn if they are off screen. No ETA on a fix though.

  • Particles and shadows paste fine here.

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