R0J0hound's Forum Posts

  • You have a few options.

    One could be to use catmull-rom splines to do the curve:

    http://www.scirra.com/forum/follow-path ... page1.html

    Use this behavior:

    viewtopic.php?t=67833&start=0

    Also could use the qarp() and cupic() expressions:

    about-the-new-interpolations_p787879?#p787879

  • Just a side note you can safely remove the second execute javascript action, it does nothing.

    I have no solution for that nw.js issue. It's not anything we're doing wrong, it's probably just a problem with the library.

  • navel35

    Only version 6.1.1 will probably be used for the lifetime of this plugin. To use version 7, I would have to port it to Javascript myself, but I don't have the time for that. The only additional feature it would have is rounded shapes, but it's not essential.

  • Ok, I'm lost now.

    All this talk about JavaScript is irrelevant since events aren't JavaScript.

    Re-reading the op is the question why only one object is created with those events?

    The system actions are only done once so you would have to add a for each to create an object for each of another one that meets that condition. Now if you used a sprite action instead it would automatically be done for all the picked instances of that sprite.

  • Functions are only run when you call them, and when they are they are run as if they were inserted in place of the call minus any picking.

    Creating objects does create the object right there and picks it, but you can't pick it as normal elsewhere until the next toplevel event. Here's some info on that to help explain what occurs:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • johnsrd01

    Try this one:

  • Well 64 bit floating point numbers only keep track of 15-17 significant digits, so that would explain one part of it.

    To get around it you could use two variable with say 10 digits a peace. Then when the second half is at 11 digits, remove the first digit and add one to the second half. Or something like that.

  • I thought he meant objects positioned around the ball, but I may be wrong.

    Anyway's here's an example of the first idea i had:

    https://www.dropbox.com/s/1btz21f1ny84g ... .capx?dl=0

    It's good enough for the bullet behavior because the bullet behavior doesn't have perfect bounces either.

    More precise stuff here, if you're ambitious.

    viewtopic.php?f=148&t=91829&p=718888&hilit=SAT#p718888

  • Phealin

    The .TileAt(x,y) expression should give you the ID. Just look at it before you erase the tile.

  • Well, your question isn't one that is quickly answered. Out of those that use ads and the android export, most expect it to just work without having to mess with the stuff you posted which would make more sense if you were making an app from scratch. A quick search didn't yield any issues like it on the forum , so I guess not many others have encountered the same problem yet.

    If it is a new law then I'd assume Scirra will modify the exporter to comply sooner or later. Maybe try tagging Ashley in your topic as it would be relevant to him.

  • The chipmunk physics behavior has a way to get the point of collision, but other than that you'll have to calculate it yourself for anything else.

    For one idea you could look here:

    That capx has a way to calculate a normal. If you create an object at the ball, and then move it by the radius in direction of the normal with the "move at angle" action, then you should get a point of collision.

    I'd make a capx but my pc seems to be dying bit by bit and C2 has been the latest victim. I'll see if a reboot helps.

    For the absolute most precise way you could use the SAT (separating axis theorem) on the ball and wall. That's usually used for resolving a collision, but it can also give you the point of collision. I've made some capx's of it elsewhere on the forum.

    Or you can do the math directly. Find the formula for the distance between a point and a line and use it to find the distances to the four lines of the box, only check that the point if projected on it land within the segment, then find the distances from the four corners. The closest of any of those will be the one you use to get the normal and collision point.

    I've done both before, and they work well although can be a bit complex to setup. An approximation is usually good enough as with the first idea.

  • irina

    I'd just paste that paster onto a smaller paster object in the area you want to save and then use the .imageUrl of that to save with the browser object. Keep in mind it only saves as png, not jpg.

    sir LoLz

    You could use Paster.ImageUrl to access the image so you could load it.

  • Well... hmm, you could just create the highlighted squares around the center one with a bunch of create actions. But I consider that a brute force way and I'm very lazy when it comes to repetitive stuff like that.

    On a side note you certainly can control objects you created with events. There just are a few picking things you need to consider.

    For instance:

  • Well you could just make the shapes be sprites with the drag and drop behavior. The connections and verifying the correct position would be a lot trickier, but as always any problem can be solved by breaking the problem down into simpler sub problems.

    The most I've done is some node based stuff here:

    Similar perhaps, so it could help with ideas.

    D3.js is cool and all but it's something on it's own which isn't really combinable with C2. I mean you could but it would be simpler to just use it.

  • jobel

    You can't do it with just one formula, you need a variable that you change over time to do it.

    One you could use is speed. It starts as 0 and it increases over time so you get an easing in effect.

    Add 100*dt to speed

    rotate self.speed*dt degrees toward target_angle

    In the actions above the 100 is the acceleration.

    You can also make an easing out effect with it by giving speed an initial speed and using negative acceleration to slow it down.

    Set speed to max(self.speed-100*dt, 0)

    rotate self.speed*dt degrees toward target_angle

    The max() is used above so the speed never becomes negative. The one problem is you need to handle is if the start speed is too low the sprite will stop short. To fix that we can calculate what the speed should start at with:

    speed= sqrt(anglediff(self.angle, target_angle)*2*100)

    Or instead of 100 use whatever you're using as an acceleration.

    Next to do an easing in-out effect (which is basically what the first capx I posted) you can accelerate or deccelerate depending on the stopping distance which can be calculated with:

    dist = (speed^2)/(2*acceleration)

    So then it can be reduced to two actions as follows:

    global number acceleration=100

    global number target_angle =270

    every tick:

    --- set speed to max(0,(((self.speed^2)/(2*acceleration)<anglediff(self.angle, target_angle))?acceleration:-)acceleration)

    --- rotate self.speed*dt degrees toward target_angle

    You may also want to reset the speed to 0 when the target is reached.

    Here's a capx:

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

    It differs from the first capx in that it doesn't try to be physically accurate.