R0J0hound's Forum Posts

  • Look at the canvas plugin for an example of this. There are perfomance issues when having the plugin not use webgl when the rest of the game does use it. The issue is namely that the html5 canvas needs to be copied to a webgl texture to be able to be drawn.

  • navel35

    To make it not use webgl just set set webgl to "off" in the project properties.

    I don't use mobile exports so I don't know what's amiss.

  • Ruskul

    Ideally you'd just make one plugin. A simplish design would be the make it an object you can put on the layout with zorder. That would mark where the effect would be applied. The plugin by default wouldn't have a effect loaded so it would do nothing when it draws. You'd load an effect as some text with an action which would compile the effect so it can be used. Then you'd need an action to set texture parameters and number parameters. That would give you a way to do full screen effects. Not terribly hard, just need an evening of motivation to put it together.

  • Ruskul

    I just saw your post here after replying in that other topic.

    Picking multiple textures to use to can be done in events easily. In my paster object the "draw textured quad" action just grabs the texture form some other object you specify. The same thing could be done in this case.

    Also to be clear you'd have to run the shader through the plugin instead of using C2's effects. Previewing in the editor wouldn't be possible in C2.

  • I don't know how simple it would be to add. To me it looks not so simple with my imperfect understanding of how C2's renderer works.

    However that's not my my point. My point is it is this could be done in a plugin currently, if you're willing to use webgl directly. Most plugins just use C2's provided drawing functions within the drawgl() function, but you can use any webgl in there as long as you:

    A. finish C2's current render batches at the start of the function.

    B. At the end set any webgl states you changed back to what they were at the start. There are some that don't need to restore, it just depends on what the renderer expects to stay the same.

    As a cursory exploration into this I did some custom webgl in this plugin:

    Basically it draws one large 2d mesh instead of multiple quads. In a similar way you can use your own fragment and pixel shaders and give them any parameters you'd like. This is where you'll need a good webgl tutorial as C2's way of using effects wouldn't be used.

  • jkleffel

    You can download it in the first post. There's also a sticky topic on how to install plugins.

  • You'll have to look at a few other effects for the exact name of it but other than percent you have number or something. Those are the only two.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ruskul

    Nope, I never got around to it. What it would consist of is just what I posted here.

  • Hmm...

    One thing you could try is to use the "set minimum framerate" action to set it to 60. That way dt will stay at 1/60 instead of going to 1/30 at times. That should mostly solve the pixel step varying, but the game will slow on less powerful pcs. Dt will still vary a tiny bit so you may have the occasional instance where things will move 2 pixels instead of one. I suppose this can be tightened up a bit by doing like newt said and making your own movement system but that is really a last resort.

    Another idea to get things smoother is to only use speeds that are evenly divide into 60. 36 doesn't but speeds like:

    1,2,3,4,5,6,10,12,15,20,30,60 will give a more even motion.

    3

  • In your output it looks like the sprites are resized. The actual sprite size should stay the same.

  • [quote:2ap6k76q]Have another question now, since I moved the scroll to center isoView within the layout. How do I translate mouse within isoView to the map grid?

    ou can use the equation posted above:

    mapx = 0.5*x+y+iz-400

    mapy = -0.5*x+y+iz-80

    just use mouse.x(layer) an mouse.y(layer) for x and y.

    For pathfinding you can either try to shrink the grid size, use a grid based pathfinding plugin or do your own pathfinding with events.

    Searching for astar or dijkstra will give some event based examples.

  • Something like (Scrollx-originalx)*0.5 for horizontal parallax. Vertical is similar. Replace 0.5 with the whatever rate you want.

  • Shadowblitz16

    Have a look at the "paste object" action, it will draw another object to the canvas in the same spot it is overlapping the canvas.

  • justifun

    First you need to make the box movable.

    velocity way:

    set velocity to rect((mouse.x-sprite.x)*10, (box.y-box.y)*10)

    and set it to 0 when not dragging

    acceleration way:

    Keep the box from falling from gravity with:

    on box prestep

    --- apply force rect(0, -gravity*mass)

    and give the box a max speed at the start of the layout.

    then to move:

    apply force rect((mouse.x-sprite.x)*1000, (box.y-box.y)*1000)

    and when not dragging give a slowing force.

    apply force rect( -velocityx*1000, velocityy*1000)