How to check what the JS syntax is for an event in Construct

0 favourites
  • 4 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hi Constructors,

    Please excuse my noobness in both JS and Construct.

    I want to know how I can view the javascript syntax of an event that happens in Construct, so that I can use it in the scripting.

    For example here, I'm trying to make the Player jump when the mic volume is high enough, so I want to take the action from the bottom - simulate jump on the player platform behavior - and put it inside the if statement right above it. But I don't know how to write it in Javascript.

    Any input appreciated. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I got closer using another answer in this forum, but still not quite there.

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

  • Thank you. Coincidentally I already started that learning-Javascript-through-Construct course, and it's really good. Pleasant way to learn.

    Will look into the examples too, I hope I'll learn from that how to get it done.

    Cheers

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)