I bought a game made with Construct 2 and exported the game as an HTML 5 game. I am trying to figure out where the event happens when someone clicks the "Play" button on the game.
I am also trying to figure out where the event happens when the game ends. The game loads a texture at the game end, so I figured if I just searched for the texture, I would see where it is being called. However, this wasn't the case.
The game is located here: https://0.s3.envato.com/files/93902013/index.html
Can someone help?
The javascript for the game is here: https://0.s3.envato.com/files/93902013/c2runtime.js
Do you have the capx, or would you like to mess around in the javascript exported?
Construct2 doesn't export an easily readable javascript, for obvious reasons..
Develop games in your browser. Powerful, performant & highly capable.
It is about a million times easier to make adjustments from the .capx, not the exported project. Although your example is not minified, exported projects are not designed to be modifiable, or even to make any sense.
Ashley is right. Take it from Master Ashley
Yeah, attached is the capx file. Basically what I am trying to do is call a javascript function "gameSessionStart()" at the beginning of the game when the play button is pressed and "updateScore(score)" at the end of the game. These functions are coming from an imported javascript file in the index.html folder. These functions connect to my database.
Couldn't you use Ajax from within Construct2 for that..
have it "talk to" a php which calls the javascriptfunction, or something like that?
I am not actually to familiar with Construct 2. That's why I was going directly into the Javascript. I figured if I could find the right calls, I could just call the JavaScript functions there.
You can call javascript functions through the browser object..
https://www.scirra.com/manual/110/browser