R0J0hound's Recent Forum Activity

  • All the plugin does is load an url. Any caching is completely out of it's control as far as I know.

  • Personally I hate populating arrays one at a time like that. Also is the id just +1 from the array index at all times? I'd make a function to initialize in a cleaner way.

    Start of layout

    function call "initGun" (1, 10, 400, 1)

    function call "initGun" (2, 5, 400, 1)

    function call "initGun" (3, 40, 300, 3)

    function call "initGun" (4, 100, 200, 10)

    On function "initGun"

    GunArray Set value at (function.param(0)-1, GUN_ID) to function.param(0)

    GunArray Set value at (function.param(0)-1, DAMAGE) to function.param(1)

    GunArray Set value at (function.param(0)-1, SPEED) to function.param(2)

    GunArray Set value at (function.param(0)-1, FIRE_RATE) to function.param(3)

    And you can also make a comment by adding another parameter that you don't use. ex:

    Start of layout

    function call "initGun" (1, 10, 400, 1, "pistol")

    function call "initGun" (2, 5, 400, 1, "rifle")

    function call "initGun" (3, 40, 300, 3, "shotgun")

    function call "initGun" (4, 100, 200, 10, "pea shooter")

    If I had an immense amount of guns I'd go a step further and add a txt file to the project that I'd load and with ajax and parse the data from it with tokenat().

  • You can use equations like the following if you're using physics equations

    http://en.wikipedia.org/wiki/Orbital_sp ... ital_speed

    There are some capx here:

    how-do-i-set-up-an-span-class-posthilit-orbit-span-using-physics_p855815?#p855815

  • Lerp (a, b, t) as an equation is:

    a+t*(b-a)

    Clamp(a,b,c)

    Just takes a value "a" and limits its value to between b and c

    This is all that clamp does:

    If a<b set a to b

    If a>c set a to c

  • Well you first can calculate the percentage of mouse.x across the screen with:

    percent = mouse.x / screen.width

    When percent= 0 you want bar.x = 0

    and when percent = 1 you want bar.x = screen.width - bar.width

    This is assuming there is no scrolling going on and the origin of the bar object is on the left.

    You then can use lerp to set it up:

    bar.x = lerp(0, screen.width - bar.width, mouse.x / screen.width)

    You may also want to clamp the percent value so it stays in the range of 0 to 1 like so:

    bar.x = lerp(0, screen.width - bar.width, clamp(mouse.x / screen.width, 0, 1))

  • mattb

    In event 21 you use the loopindex expression and the "for each collision pair" doesn't set it to anything, so the contactpointX() expessions will always return 0, since loopindex defaults to -1 when not in a repeat, for, or "for each sprite" loop. Each collision pair can have more than 1 contact point so adding a repeat Player.Chipmunk.ContactCount times condition to event 21 will help.

    Pin joints aren't like the pin behavior. They are a rod connecting two objects. So when you add the joint the distance between the anchor points are kept. See the js demo of it here:

    https://dl.dropboxusercontent.com/u/249 ... oints.html

    According to the chipmunk forums the way to join two objects together is with two joints. A pivot and a gear joint. I apologize fo the seeminly complicated formula used for the phase of the gear joint. It's the signed angle difference between the two object angles. angle(0,0,cos(a-b),sin(a-b))

  • When setting the force use polar instead of rect and use the angle() expression to get the angle.

  • Pick by uid is a direct way to pick a particular instance. You could use a 2d array and store the uids of the objects on the respective grid. That way you can have the same advantage as a tilemap.

    Basically you can organize them any way you want and store them in an array for quicker access.

  • For 2d you can just use the distort map to bend the road in curves. For 3d the problem of using a textured road and placing objects becomes a full 3d one except the math has to be done yourself. You can use z with distort maps so the drawing capabilities are there. To position objects you'll have to set the zelevation on sprites as I recall.

    About the curving in the example, that's all it is. I never refined it to look right.

  • Picking with sprites has to check all the currently picked sprites. Tilemap tiles on the other hand aren't picked, you select them directly based on tile location.

    I don't quite follow your description but if you have a "for each" which calls a "for each" with no "pick by evaluate" and 4000 instances you'll get 4000*4000 iterations. With picking you'll get much less depending on what's picked. On another note picking is run over all the picked instances so an event by itself that uses "pick by comparison" will have to run the comparison on all 4000 instances, and since functions reset picking, each time it's run 4000 comparisons will have to be made. So again a total of 4000*4000 comparisons.

    Tilemaps don't do picking on tile. Checking any tile only takes 1 check. It can be refered to as a spacial hash.

    overall sprites can be anywhere so you need to loop over all of them to find one in a specific spot.

    Tiles are in specific spots so you can just check that spot to find the tile.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The 3d effect can be done like in here:

    For just curving sprites in 2d you can use distort maps.

  • That doesn't look like a plugin. Look in the other plugin folders to see what files a plugins is expected to have. The main two files c2 is looking for is runtime.js and edittime.js. If you can't find those files for what you're trying to install then it may not be a plugin.