How do I find the play function in an HTML 5 game?

Get help using Construct 2

Post » Tue Jul 22, 2014 2:27 pm

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?
B
5
Posts: 10
Reputation: 237

Post » Tue Jul 22, 2014 2:29 pm

The javascript for the game is here: https://0.s3.envato.com/files/93902013/c2runtime.js
B
5
Posts: 10
Reputation: 237

Post » Tue Jul 22, 2014 2:49 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 22, 2014 2:53 pm

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.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Tue Jul 22, 2014 2:57 pm

Ashley is right. Take it from Master Ashley
B
257
S
43
G
15
Posts: 1,992
Reputation: 41,535

Post » Tue Jul 22, 2014 2:58 pm

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.
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 10
Reputation: 237

Post » Tue Jul 22, 2014 3:03 pm

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 told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 22, 2014 3:16 pm

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.
B
5
Posts: 10
Reputation: 237

Post » Wed Jul 23, 2014 10:18 am

You can call javascript functions through the browser object..

https://www.scirra.com/manual/110/browser
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests