popup plugin

  • I am building functionality in my learning management system where game play is interrupted by a popup that sends kids to the test engine where they answer one question. When the kids hit the submit button, the popup disappears and gameplay resumes until they hit another popup instance (each game interrupts differently).

    I bought one of those construct 2 game packs, and am trying to figure out this sdk system where I can do the javascript for the custom behavior in the game. I have the code working in noon-construct 2 html5 games, but am bloodying my forehead on how to work with the plugin.

    I have the plugin renamed and it appears in my objects panel, and it appears I should code down at the bottom, where it says "MyCondition". Does anyone have advice on this kind of matter? It would be greatly appreciated from my side.

    Here is the code in a game that works.

    function overShowOver() {

    var url_string = window.location.href;

    var url = new URL(url_string);

    var user_id = url.searchParams.get("u");

    var lesson_id = url.searchParams.get("l");

    var num_question = url.searchParams.get("q");

    var i;

    var link;

    for(i = 0; i < num_question ; i++){

    console.log(i);

    console.log(localStorage.getItem("question"+i+"lesson"+lesson_id+"user"+user_id));

    if(localStorage.getItem("question"+i+"lesson"+lesson_id+"user"+user_id) === null){

    link = 'https://mindpocket.com/student/lessons/question/'+lesson_id+"/"+i;

    popupWindow = window.open(link,'popUpWindow','height=500,width=500,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');

    localStorage.setItem("question"+i+"lesson"+lesson_id+"user"+user_id, "check");

    break;

    }

    }

    Meantime, I'll keep cracking my eggs on it.

    Thanks a lot.

    Jeff

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)