Help - CoolMathGames API

0 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi all. Has anyone worked with api coolmathgames.com?

    Help, where should I write?

    Did it like this now:

    When choosing a level from the menu - "coolmathCallStart();"

    At the beginning of each level - "coolmathCallLevelStart('"&currentLevel&"');"

    When restarting the level - "coolmathCallLevelRestart('"&currentLevel&"');"

    Tagged:

  • You need to connect the JS library first.

    In your event sheet in the event where a level is selected, right-click on "Add action" and choose "Add script". Add this script (without quotation marks):

    coolmathCallStart();
    

    Try running the game, press F12 and check if there are any error messages in the browser console.

    If the previous code works fine, you can add the other functions:

    coolmathCallLevelStart(runtime.globalVars.currentLevel);
    
    and 
    
    coolmathCallLevelRestart(runtime.globalVars.currentLevel);
    
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • https://www.dropbox.com/s/96i93oveljweqby/Coolmath%20Construct%203%20guide.pdf?dl=0

    Hello. I did everything according to this instruction(official). It is right? I don't understand only one thing... script 'coolmathCallStart' where to execute? in the game menu after pressing the play button? where to execute the 'coolmathCallLevelStart' script? after pressing the "next" button? Or at the start of a new level?

    ThankYou!

  • where to execute?

    In your event sheet! You probably have an event like "Touch On Touched StartButton" or something similar - add the script to that event.

  • > where to execute?

    In your event sheet! You probably have an event like "Touch On Touched StartButton" or something similar - add the script to that event.

    Here is the moderator's message: ...but it seems that I'm still getting an undefined value when starting Level 1 instead of receiving the value in the API.

  • That official instruction is outdated, you should tell CoolMathGames that.

    .

    "Browser Execute Javascript" is an old method. I think you should use inline scripts - see my fist comment in this post about how to add them.

    Also, click on the Coolmath.js script in the project and on the left toolbar choose its purpose: "Import for events".

  • That official instruction is outdated, you should tell CoolMathGames that.

    .

    "Browser Execute Javascript" is an old method. I think you should use inline scripts - see my fist comment in this post about how to add them.

    Also, click on the Coolmath.js script in the project and on the left toolbar choose its purpose: "Import for events".

    Thanks. I did so. I'm waiting for them to answer.

  • That official instruction is outdated, you should tell CoolMathGames that.

    .

    "Browser Execute Javascript" is an old method. I think you should use inline scripts - see my fist comment in this post about how to add them.

    Also, click on the Coolmath.js script in the project and on the left toolbar choose its purpose: "Import for events".

    Thanks! Happened.

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