R0J0hound's Forum Posts

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.
  • 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.

  • Extracting the runtime portion from a minified export is not really doable. I mean at most you could possibly get the minified version of the runtime with a lot of trial and error. Unfortunately all the names would be mangled so it would be a real chore to fix that into a usable form.

    To be able to open a capx that uses one of those plugins you'll either have to remove all references like newt says, or you can recreate the edittime portion from the capx. After you unzip the capx you can get all you need to recreate it.

    The plugin's id can be retrieved from the .caproj file under used plugins or behaviors.

    Next you need to add all ACEs. The event sheet xml stores the id of the action/condition and all you need to recreate it in the edittime is the id and parameters need to be the same. Properties can be done similarly by looking at an instance in a layout xml. just keep the same order and type and you should be ok.

    That at least can let you open it. Hopefully your plugins are in an old c2 install somewhere though.

  • The Sprite.pickedCount expression gives that info.

  • Look here for everything about hexagon grids (all kinds). You should be able to do what you want refering to that.

    http://www.redblobgames.com/grids/hexagons/

  • This is a situation where joints wouldn't really cut it. The box2d and chipmunk libraries let you attach multiple shapes onto the same physics object, which is like a perfectly rigid joint. The only work needed is calculating the center of mass and inertia of the object as shapes are added/removed.

    It's probably easier to to do by accessing the js libraries themselves to do it rather than using the behaviors. Not to mention it would give more control.

  • Ideally you'd use the plugin sdk to access javascript.

    But you can use the Browser object with it's exec js action to run some javascript.

    You can load a js file in your project folder as if it was included in your html file by executing this:

    "var js = document.createElement('script');
    js.type = 'text/javascript'; 
    js.src = 'chipmunk.js';
    document.body.appendChild(js);"[/code:300sntdv]
    The library takes time to load though, so you can't use it immediately.
    
    Another option is to load the the file into a variable with the ajax plugin.  Then you can use exec js with that.
  • Couldn't you just flip everything?

    switch width and height in the equations. As well as the x and y's?

    So maybe this?

    On drag drop

    • set x to round((Touch.x - 280) / self.width- self.y / 2))
    • set y to round(4*(Touch.x - 320)/(3*self.height))
    • set position to (self.width*(self.x+self.y/2) + 280, self.height*self.y *3/4 +320)