Ashley's Recent Forum Activity

  • I'm not sure what you mean? What pool? The code you showed will just GC normally so there's no need to specifically clean that up in a release method.

    If you want to know when another object is destroyed, you can listen for the runtime "instancedestroy" event.

  • Normally in JavaScript unused things just get garbage collected, but this does not cover all possible kinds of resources like GPU textures, active WebSocket connections, etc. So the engine provides release methods that are called just before objects are discarded and left for GC, so you can release any other kinds of resources that do not normally GC. (It's also sometimes helpful for development/debugging purposes - clearing references, or setting a 'isReleased' flag, can help identify dangling references to released objects.)

  • Applying editor-side changes while the editor is open is an extremely difficult problem. What happens to the project you are looking at if the addon has a breaking change made while you have a project open? There are probably hundreds of ways the editor could crash after that, and it's infeasible to spend weeks or months doing all the work to sort out all those possible cases instead of doing other things like new feature development, just so you don't need to reload the editor during development.

    That doesn't apply to the runtime though, so you can in general make any runtime change and it will apply on the next preview.

  • You do not have permission to view this post

  • In normal usage of Construct, it should be impossible to save a project with invalid expressions.

    If you do something like addon development and make a mess of a project, e.g. by saving it with one expression, making breaking changes to the addon, and then trying to open the project again... that's kind of on you!

  • I realized this is confusing and renamed it for the next beta to "set min/max delta-time", as that better describes what it does - it's essentially a clamp on the value of dt.

  • If you're using a local server for addon development, and you end up in a mess, the easiest way out is to clear browser storage (which has the effect of uninstalling all addons).

  • It's expected. In general as a dynamic language like JavaScript, it is not possible to identify exactly where all properties are consistently used and automatically update them. You can use a text-based find-and-replace but you should review every match to make sure it doesn't update something incorrectly.

    One of the benefits of Construct's object model is it can rename things for you automatically and exactly (except where string "by name" references are used). TypeScript also uses static typing and tools like VS Code can use "Rename symbol" which should help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The general coding standard is properties and functions beginning with an underscore are private, and anything else is public. To follow that convention, this._worldInfo is a private property that the class itself can use, but outside callers can use GetWorldInfo().

    Honestly, JavaScript performance is so outstanding these days that worrying about references/GC is very likely premature optimization and a waste of time. These days I ignore all that stuff for engine code and 95%+ of the time it works out fine. The main problem is people underestimating how good the technology is. See the manual section on Performance tips most of which applies to JS coding too.

  • If you are looking at the code in Construct's built-in behaviors, all of that is considered internal details for support purposes, and we won't provide any support for that or answer any questions about them. It is not intended that anyone looks at internal code, and internal code can change at any time for any reason, including completely replacing it.

    Many of the behaviors are also pretty old (with code originally dating back 10 years or more), and as anyone who has dealt with codebases over that period of time can advise, such code is often full of odd quirks, compatibility changes, and other weird stuff, and so I would strongly caution against trying to infer what kind of code you ought to be writing from internal code.

  • Event blocks don't really have a JavaScript equivalent. They are a different paradigm and are exported as data which the engine interprets. There are lots of JavaScript examples in Construct though which show how you can build various types of things with coding - filter by the 'Scripting' tag in the Example Browser. Ghost Shooter Code is a good one as there is also an event sheet equivalent example (although you'll see they're quite different).

    Both your code snippets include syntax errors. I would strongly recommend going through the tutorial series Learn JavaScript in Construct which covers the basics and should help you avoid these mistakes.

  • You probably want to use the 'Move to' behavior instead of timeline movement. You can tell the behavior to move along a timeline and then it moves through the points at a fixed speed instead of on the timing schedule, as in the Move along path example.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,424,439 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x108
    Coach One of your tutorials has over 1,000 readers
  • x62
    Educator One of your tutorials has over 10,000 readers
  • x3
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x35
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs