R0J0hound's Forum Posts

  • There isn't any program that does that currently.

    Most isometric games made in C2 don't use Tiled at all, they just turn on grid snapping and position sprites in C2's editor.

  • The wait is messing it up in this case. What it's doing is pushing the function call to the end of the event sheet, and what you want is the call done in place.

    When creating a new object this defines when it can be picked:

    and

    "pick by uid" is the exception as it works for any object that was created.

    For accessing new object's immediately from a function you should pass that object's uid. Then you can pick the object by uid in the function, and reverse it to pick a sprite from the sprite2.

    For ex:

    call "hasframechanged" (sprite2.uid)

    on function "hasframechanged"

    sprite2: pick with uid function.param(0)

    sprite: pick closest to (sprite2.x, sprite2.y)

    sprite: x = sprite2.x

    sprite.y = sprite2.y

    --- sprite: set ischanged to true

    AllanR

    The newly created object is added to the object list at the next toplevel event as per the links above.

  • The simplest would be to use multiple layers in tiled and edit the capx to get more than the first layer. For example you could have one layer define the collisions.

    To get it in the layout would need one to write a program to convert a tmx file to a C2 layout file and add it to your project.

  • A simple way would be to create a bunch of bullets from the source object and set their angle to a random direction, also save that angle to a instance variable on each. Next you just move the objects and bounce them as they hit walls. Ideally you'd do it the same way as in that laser example. Now as soon as one of those objects collides with the other object, use that object's initial angle for the laser and delete everything else.

    Sending lots of lasers will use more cpu, this is true, but when it's the only solution atm there's not much you can do.

  • The simplest idea would be to send lots of lasers from one object and let them bounce until one hits the other object, then you can discard the rest.

  • They do something entirely different to what my capx does. My capx loads an isometric tmx file to sprites, and those plugins help with motion and such in isometric. I couldn't tell you more because I've never used them.

  • It just loads the tmx to a bunch of sprites. After that you can do whatever you like with them.

  • Juicy

    You could make you're own loader for isometric tiled files. You'll just need to use sprites instead of the tilemap object.

    Here's an example:

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

    The tiles are imported into the sprite's animation as a sprite strip, and the tmx file needs to be saved with csv encoding.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the first link I posted I did show how to use interpolation for all easing effects. What I'm saying is only using a fixed value (0.1 is fixed) for the last parameter won't give anything but an easing out effect.

    Basically all the interpolation functions define some kind of curve from a to b. For example cosp() could look like this:

    a|--.
     |   `-.      
     |      `.
     |        `.
     |           |           \           
     |             |             \          
     |              \         
     |               `.         
     |                 `.       
     |                   `-.    
    b|                     `--,
     +-------------------------
     0                        1[/code:1n6dc089]
    
    The last parameter specifies a location along this curve from 0 to 1.  Now if you gradually increase that value from 0 to 1 you'll get whatever easing as the curve provides.  If you instead just use a fixed value for the last parameter and keep changing "a" then none of the functions will give any advantage over just using lerp.
    
    But the best proof is to try it.
  • akkthedev

    To detect a pixel you first need to paste that object into the canvas object, then use the canvas.rgbaAt(x,y) expression.

  • I haven't tested this, but it should work:

    // save sol of type to instList
    var sol = type.getCurrentSol();
    var instList = sol.getObjects().slice();  //the slice() function will copy the array
    
    // filter away instances that were deleted
    instList = instList.filter(function(inst, i, arr)
    	{
    		var iid = inst.get_iid();
    		var instances = inst.type.instances;
    		if( iid<instances.length && instances[iid]===inst)
    			return true;
    		else
    			return false;
    	});
    
    // set sol later
    var sol = type.getCurrentSol();
    sol.instances = instList;
    sol.select_all = false;
    obj.applySolToContainer();
    [/code:3lr99elb]
  • I think you need to copy the list. Your code above just references it. I forget how exactly but a searching for "JavaScript copy array" should give a way. Also when setting the sol you'll probably want to push a copy of the current sol first. I think there's a runtime function for that.

    A useful reference could be to look at the "pick all" condition or maybe even the "pick by uid" condition.

    For verifying the instances still exist:

    One way that would work could be to find each instance in their object type's list of instances.

    Another idea that could be investigated would be If instances somehow were marked as dead. If it wasn't then you'd need to check if the uid was the same. If it wasn't it would be a recycled instance.

    Just some ideas. I'm not near a dev PC to try any out ATM.

  • You can get a good speedup by utilizing an array to make the cell lookup faster.

    See here for an example:

    The slowdown you're encountering has to do with picking. Event 23 in your capx is the bottleneck.

    If you're using 40x40 then you have 1600 cells, and event 23 does this:

    cell: coordX = checkX //this filters the 1600 cells down to 40

    cell: coordY = checkY //this filters the 40 cells down to 1

    1600 times.

    The idea in my capx is to just do everything in the array, so I can lookup if a cell is on or off with a direct check. Then to update it visually I just loop over the sprites and set their visibility depending on the value in the array.

  • Make that part transparent so you can see the bricks behind it?

  • The difference between lerp and anglelerp is anglelerp lerps in the closest direction.

    Also I'd like to point out that while something like:

    lerp(a, b, 0.5) will give an easing out effect, so will cosp(a,b,0.5), qarp(a,b,c,0.5) ... etc.

    As long as a constant value is used for any of the interpolation functions it will only give an easing out effect.