javascriptphpvariablesscopeconstruct-2

Accessing Construct 2 generated JavasScript through custom JS


I have a game built with Construct2 Engine, I'd like to get the value of the game user's score using external JavaScript .. Is there any way to do this ?

Thanks


Solution

  • Yes, you can use c2_callFunction to get or set value directly from construct.

    For example alert(c2_callFunction("get_score"));

    and in your construct2 project:

    Construct 2