skymen's Forum Posts

  • Hi, I'm currently trying to make a fast motion blur effect for my game

    Here is the fx's file code:

    //////////////////////////////////////////////////////////////////////////
    // Motion Blur effect
    varying mediump vec2 vTex;
    uniform mediump sampler2D samplerFront;
    uniform mediump float quality;
    uniform mediump float seconds;
    
    function scrUpdater() {
    		mediump vec4 front = texture2D(samplerFront, vTex);
            gl_FragColor = front + oldfront*quality/100 ;
        }
    
    void main(void)
    {
    	if (seconds == 0){
    		mediump vec4 front = texture2D(samplerFront, vTex);
            gl_FragColor = front;
    	}
    	else {
    		mediump vec4 oldfront = texture2D(samplerFront, vTex);
    		setTimeout(scrUpdater(), 10);
    	}
    }
    
    [/code:q701en8b]
    
    When I use it in Construct 2, I get this error:
    
    [img="http://image.noelshack.com/fichiers/2015/52/1450886713-javascript-error.png"]
    
    Can someone help me?
  • Hey, as no one made a motion blur effect for construct, I'm trying to do it on my own.

    Anyway, I'm new to javascript, so I got a few questions.

    I've made some researches on how the effect should work, and I found that what the effect does is:

    1- Copies the canvas (or whatever name you call it, the part of the game that is currently displayed on screen)

    2- Adds to it some blurry effect

    3- After 1 frame, blends it to the current canvas

    4- Go back to step one.

    So, I know how to blend images.

    I kinda know how to add that blurry effect.

    But, the whole problem is that I neither know how to "copy" the canvas nor how to "wait" 1 frame

    Could some awesome javascripter help me with this one? ^^

  • Hi. I would like to create a motion blur effect in construct 2 as there is no one ever made (if there is one, could you give me it's link?).

    So my question is, how do I create an effect for construct 2?

    Is there any tutorial that could help me?

  • This has already been made in a lybrary before: (add in https)://www.clicktorelease.com/tmp/threejs/mblur/

    Using three.js, can't someone port it to construct 2?

  • Yes.

    Go to file>New>Example:Lightning

  • What do you mean by "follow the scroll"?

    If you mean that your character should continue heading right, I recommand you to look at the built-in runner template.

  • Make a Global event page and in it, test if the LayoutName=SaveLayoutName

    If not, then go to the layout.

    On end of app, save the value of SavedLayoutName by using the Local Storage Plugin.

    Or you can just use the "save game" action, and load game each time you launch the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think that the physics behavior already manages weight. Just play with the density value in the behavior parameters.

  • To check if a layout has already been used, you can set an array that way:

    When you wanna load a layout, you check if the array contains the layout name.

    If so, reload another random layout

    Else, load it and set a new value in the array containing the Layout Name.

    On new games, reset the array to 0

  • Ok I did it.

    Here it is:

    (add in https)://mega.nz/#!h01iAb7K!dAfBI_0W9bkPZtaUWB1PdSqYtzLSa4atRml154Ch1Pc

    Good Luck.

  • Didn't want to put a .capx file as there is a lot more code than just this, and it could have been disorentating. However here it is.

    (add in https)://mega.nz/#!l901XITC!-X0nNVQqgELUXHseqkmHBNAZ1nfeL9RlTqZwBfTueMU

    skymen

    Yes. In Construct all the subevents work at the same time. Not in order you put them.

    You should use "else" statement or "trigger only once" to get rid of the loop.

    What do you mean by this?

    This should not change a thing as each door has an ID set in a variable, and each button also has an ID. So when the button's ID is equal to the door's ID, and if the button is activated, it should open the door.

    Anyway, I'll try adding a "Trigger once while true" condition to see if it works.

  • Did you set up your default values in the family or in each object?

    This might be the cause. Also, which version of Construct are you using?

    Does this happen each time, in every family?

  • What do you mean by "special/cool text effect"?

    If you want to have good looking text, look at cooltext.com

    If you're talking about cool animations, I recommand you use the Sine behavior, and play with it's scale and rotate values.

  • You should add in instance variable that you set for each dot. Then, in your condition you add a condition where you test if both values are equal.

  • I've made some code that should open a door if a button is activated, depending on both's IDs.

    Here is the code:

    However, the code doesn't work as expected...

    In fact, it waits till all the lower IDs are activated to activate higher ones. Also, for the rotating doors, the door work randomly. Sometimes it does, sometimes, it doesn't.