R0J0hound's Recent Forum Activity

  • Not a bug.

    The correct way to use the distance function is:

    distance(Pos1.X, Pos1.Y, Pos2.X, Pos2.Y)[/code:1czenn2n]
    Notice the x,y pairs are next to each other.
    
    It's exactly the same as:
    [code:1czenn2n]sqrt((Pos2.X - Pos1.X)^2 + (Pos2.Y - Pos1.Y)^2)[/code:1czenn2n]
    or
    [code:1czenn2n]sqrt((Pos1.X - Pos2.X)^2 + (Pos1.Y - Pos2.Y)^2)[/code:1czenn2n]
    
    The abs() isn't needed since any number squared is always positive.
  • newt

    I think a "set pixel" action will need to be made as "draw point" blends what it draws. A current workaround is to paste a 1x1 sprite with the "destination-out" blend.

  • Arima

    Noted. It will require some revamping of the plugin to make it match what c2 rendering does. Currently I'm pushing that task to a later date.

    shinkan

    Here is a solution for that.

    ->System: Start of layout:

    NodeWebkit: show save dialog (accept ".png")

    ->NodeWebkit: On save dialog OK

    Browser: Execute javascript "var fs = require('fs');fs['writeFileSync']('" &replace(NodeWebkit.ChosenPath,"\","\\")& "','" &Canvas.imageUrl& "'.split(',')[1], {'encoding': 'base64'});"

  • The physics has two modes "fixed" (default) and "Framerate Independent".

    With "Fixed" 1/60 is used instead of dt. This is the default and useful to have similar results from run to run. The side effect is if your fps dips below 60 then the physics objects will move slower.

    For example normally if the velocity is set to 100 and the fps is 60 then 1/60 and dt will be about the same and the speed will be 100pixels/second.

    On the other hand say the fps is 30 then dt will be about 1/30 or twice as much as 1/60 so the speed will be 50pixels/second.

    With your result of 0.833x I'd guess your fps is about 50.

    You can set the stepping mode to "Framerate Independent" with an action to make the physics use dt instead of 1/60. With a stable fps of 60 you'll not notice much of a different between the modes. The simulation can become unstable if the fps varies too much but the speeds will remain the same at 100pixels/second. At least until the fps drops below 30fps. After that 1/30 is used instead of dt. It would seem that is the minimum timestep that will be used. The result is slowdowns again much like "fixed".

    Anyway that's my breakdown of what's happening and here's my test capx:

    https://dl.dropboxusercontent.com/u/5426011/fixed/physics_compare.capx

    On another note, AnD4D Colludium I think this info is relevant to the topic you made here:http://www.scirra.com/forum/physics-forces_topic85125.html

    In summery setting the stepping mode to "Framerate Independent" will help with your situation and keep the speeds matching since your fps is in the range of 30-60. If your fps drops below 30fps then all the physics objects will slow down.

  • It could be faster, but you'll get more of a speed improvement by reworking the algorithm used.

    With a 15x15 grid of letters I can get it to find all possible words from a 60k word list in about 0.6 seconds. The biggest speedup is from loading the word list into a dictionary object which allows you to know if a word is in it with the "has key" condition.

  • Digitalsa

    Why not do it just like your code?

    You have this:

    if (x + dx > WIDTH || x + dx < 0)
        dx = -dx;
      if (y + dy > HEIGHT || y + dy < 0)
        dy = -dy;
    
      x += dx;
      y += dy;

    Which is all doable with events.

    This tutorial may be of help to get you up to speed: https://www.scirra.com/tutorials/37/beginners-guide-to-construct-2

  • kappie7

    Hmm, that is an issue. I haven't messed with any kind of android export as of yet to investigate it further.

    Robsta

    The only significant optimization is to set "Use webgl" to no. Use the paster plugin instead for using webgl.

    egos

    I imagine if I or anyone else didn't make a plugin like this then Scirra would eventually make one because Construct Classic had a plugin like it. Basically this frees them to work on other features first.

    newt

    The "invoke download" action works well for this. It's next to the "invoke download of string" action. I missed it initially as well when I first tried to do it.

  • I did it manually. Start with an empty grid and put the longer words down first while trying to find a way to make them overlap. Repeat for as many words as you can fit in the grid. After that just put random letters in the empty spaces.

  • It's the beta download. You can find the link if you scroll all the way down under "Download". Or use this link:

    http://www.scirra.com/construct2/releases/r161

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could just make the blocks invisible instead of destroying them.

    Here's a example:

    https://dl.dropboxusercontent.com/u/5426011/examples21/spread_and_return.capx

    And a no family version:

    https://dl.dropboxusercontent.com/u/5426011/examples21/spread_and_return_noFamilies.capx

  • Here's one way to do the falling rocks:

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

    /examples21/boulderdash.capx

    It differs from Bertie Booster's idea in that it uses a array for a grid instead of using overlapping at offset.

  • As it so happens I've been messing with such math lately. Calculating the velocity along an axis is a "vector projection" and looks like this:

    velocity_along_angle = velocityX*cos(angle)+velocityY*sin(angle)

    Then you can set the velocity to only be along that axis with:

    set velocity to: ( velocity_along_angle*cos(angle), velocity_along_angle*sin(angle) )

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound