Ashley's Forum Posts

  • Gravity is just a force, so can't you just set gravity to 0, and then apply a per-instance custom force instead of gravity?

  • If you run in to a problem please file an issue following all the guidelines otherwise it's impossible to help.

  • I'm afraid the time it takes for Mobile Advert to start up is handled by Google's ad network - it's out of our control.

  • One problem that has come up in the latest release is that files and folder names that start or end with a space are actually invalid (systems like Windows block creating files with such names), and Construct now enforces this too. However it means existing projects which use invalid names with spaces at the start or end cannot be opened. These projects will have also been unable to be saved as a folder project because of the use of these invalid names, so arguably they were already broken due to the use of invalid names.

    To fix it you can do this:

    1. Open the project in the previous release r388.2
    2. Go through the Project Bar and make sure nothing has a name that starts or ends with a space
    3. Save the project
    4. Open it again in the latest release r397

    If it doesn't open, check the browser console for error messages again, and go through and repeat this process checking for that name in particular.

    If you still can't get it to open email your project to supporttgw@construct.net and we'll take a look.

    Unfortunately projects using invalid names is a really difficult problem and it's very difficult to have Construct automatically deal with this. The important thing is to make sure everything in your project has a valid name, and the latest releases do now correctly validate that, so it shouldn't be possible to happen again. And if you found you were unable to use folder projects, it should work again after doing this.

  • Assuming inst is a reference to an instance, and it has an instance variable named myNumber, then you'd write inst.instVars.myNumber to access its instance variable.

    If you're not sure about how to get an instance, I'd suggest going through the Learn JavaScript in Construct tutorial series.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Browsers don't let web pages override some important shortcuts, to prevent abuse. Unfortunately Ctrl+W is one of these: there is no way for a web page to override it, probably to avoid the situation an abusive web page is trying to make itself unclosable.

    Construct should prompt to make sure you want to close the tab if there are unsaved changes in your project, though.

  • The web has no built-in file listing feature. You can only make HTTP requests to named resources. Construct knows which files are in your project, but it doesn't know if you uploaded any other resources after exporting your project, so it can't have a true "list files" features.

    It should be easy to work around though: either keep your own array of filenames somewhere, or what I'd recommend is having a top-level import for the folder. For example if you have the files:

    myfolder/module1.js

    myfolder/module2.js

    myfolder/module3.js

    Then add myfolder/main.js which imports those modules. You can use "export from" syntax to conveniently re-export everything without having to list all its exports, e.g.:

    export * from "./module1.js";
    export * from "./module2.js";
    export * from "./module3.js";
    

    Then if you import myfolder/main.js you get all the modules in that folder imported. If you need to add a new file, then you can add module4.js in "myfolder", and then add a new line in main.js to export it too.

  • I can't open the links - they say 403 forbidden. But your sample code uses premultiplied alpha incorrectly. If you want to draw with an opacity of 50%, then you need to set the color RGBA components to (0.5, 0.5, 0.5, 0.5) - because the RGB components need to be multiplied by the opacity when using premultiplied alpha. SetOpacity() only changes the alpha component, so will leave the RGB components of the current color unpremultiplied.

  • You do not have permission to view this post

  • Apologies, there was an outage of a few hours earlier. It should be up and running again now.

  • Use the instVars property. (See IInstance documentation)

  • Are you using any third-party addons? They may need updating. Construct's official features should not show this message if you export from r397 as we have already updated everything (so far as we are aware).

  • If your project does not load in the latest release, please send a copy of your project to supportbst@construct.net and we'll try to make sure that it can be opened. Assuming there is a problem with Construct itself and not a third-party plugin, then such issues are a high priority for us.

  • No, it's too late - Construct loads all textures with premultiplied alpha, so to correctly render them, you must use premultiplied alpha rendering mode.

  • There's no limit on how many addons you can install.