R0J0hound's Forum Posts

  • I think you need to detect which side is being collided with for it to work right.

    Maybe you could do something like this?

    Sprite on collided with tiledbg

    Sprite.y<tiledbg.top

    Or

    Sprite.y>tiledbg.bottom

    bounce vert

    Sprite.x<tiledbg.left

    Or

    Sprite.x>tiledbg.right

    bounce horz

    A more robust way could be to compare angles like

    Angle(tiledbg.x,tiledbg.y,Sprite.x,Sprite.y) is within 45 degrees or 0

    bounce horz

    Anyway just some ideas

  • Seems to be a general problem with destroying objects with this behavior. Not sure when I'll have time to really break it down and see what design flaw I used.

  • You can do this already.

    First select all the relevant events.

    Then right click on the selection and click "replace object".

    It will then let you pick the object to replace and what to replace it with.

    There are restrictions though. Like you can only replace sprites with sprites or tiledbg with tiledbg objects. And if any of the events access a variable or behavior, the object you replace it with needs it too.

  • I did a game like that a while back here:

    https://dl.dropboxusercontent.com/u/542 ... 9tile.capx

    It could be simpler but i was going for a dragging mechanic.

    korbaach

    I solved that by starting with it solved and then having it do 100 random moves or so.

    ajvar23

    You can greatly simplify your capx in a few ways:

    * use different animation frames instead of different sprite types.

    * only position detectors around the sprite you tap.

  • shinkan

    Well, with webgl on it uses the same drawing method that sprites use, and it is two triangles.

    Oh wait, if you're trying to do perspective it won't look right because there is no z.

    The picture here sums it up:

    https://en.wikipedia.org/wiki/Texture_m ... orrectness

    So basically the distortion only looks right if opposite sides of the quad are parallel. Something like a skew would work, but not if you do a trapezoid shape.

  • shinkan

    That's when webgl isn't used. The canvas workaround draws as two triangles and the anti-aliasing causes the seam.

  • For the infinite background portion you can just move a tiledbg that's a bit bigger than the screen so you always see it.

    Here's an example for horizontal scrolling:

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

  • To make it smooth like that you need to create sprites in the in between locations so it looks smooth. But that can be a lot of objects for a long trail so you'll probably want to tweak it to a point it looks good enough and is still fast.

    /examples30/smooth_trail.capx

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

  • Just use the blend mode on the objects, not the layer. Then set "force own texture" to true for the layer.

  • What about textures skewing, distortion etc... is this still a thing? if I remember correctly it should be possible only with webgl2, right?

    It's possible with webgl now, even C2's webgl renderer can do it, although the canvas render can't as of now. Which is why it's not a feature currently.

    I've utilized it in the draw textured quad action of my paster plugin, but had to use a workaround to make it work with canvas.

  • The procedural portion of it is easy. you can think of the whole cave as just a polyline since the top and bottom walls turn at the same x position. So then you just need a bunch of random y values. The visual part of it just needs some way to draw a polygon (canvas or paster plugins can do this).

    Here's one possible example:

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

  • Itenimum1

    Nothing's changed with the plugin of even c2's runtime that should effect the performance as far as i know.

    One reason why a large amount of collisions would be slower than with the physics behavior is the pre and post collide triggers i imagine.

  • hoanganh17

    Even better! In that case you can easily recover the runtime portion.

    search for:

    cr.plugins_.Sprite

    in c2runtime.js, except replace "Sprite" with your plugin's id.

    You should see something like this:

    cr.plugins_.Sprite = function(runtime)
    {
    	this.runtime = runtime;
    };
    (function ()
    {
    ...
    [/code:3bj6uq01]
    That's the start of that plugin.  It continues till the matching "(" in the line "(function ()".
    
    I used notepad++ to click on that "(" and use the command "Select all between matching brace" to do it, but you could use something else.
    
    All that's left is to re-create the edittime.js as mentioned before since that's not exported.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For best performance use a tilemap with a small tile size and "seamless mode" off. You'll need to do that for the examples in the link below.

    or here

    For multicolored terrain i'd say use only one tile on the tilemap and use a blend mode with a spite or canvas plugin to color it.

    In the other examples for destructible terrain the canvas plugin is used instead. Using the tilemap object also give the added benefit of just working with the collisions, whereas you'd have to implement collisions yourself otherwise.

  • C2 does have dynamic arrays, and like anything if you increase the number of things to process over time it will eventually be more than the pc can handle quickly.

    Back to the op: if you're just using the array as a list and adding to the list over time then that alone won't affect performance, just increase memory use over time. Accessing individual values from an array is just as fast if the array is tiny or gigantic. What would affect performance is if you're looping over the array when it's gigantic.

    Will this be an issue for your game? If you're only adding more values every 10 seconds tops then it would take 13 hours to get to 5000 values which still isn't an issue to loop over.