How do I embed a C2 game within a C2 game?

Get help using Construct 2

Post » Sun May 18, 2014 1:32 pm

Hi,

I have a C2 game I published as HTML5 (uses keyboard or gamma on mobile to go left and right).

I have another C2 game where I use Pode's iframe plugin to load the previous game as a mini-game. The mini-game runs fine within the iframe but the keyboard control is not working. Is there another way to include a game within a game? Tx.
B
8
S
2
Posts: 10
Reputation: 595

Post » Mon May 19, 2014 12:59 am

I figured it out, setting the iframe in focus with a little wait time after the layer is visible. Now the question is if it's possible to communicate between the games. In other words, how do I send score for example, from the embedded game to the parent?
B
8
S
2
Posts: 10
Reputation: 595

Post » Mon May 19, 2014 7:32 am

Why not just build your game with the mini game as part of it ?
B
50
S
16
G
9
Posts: 1,098
Reputation: 11,237

Post » Mon May 19, 2014 8:31 am

Image
B
15
S
4
G
1
Posts: 286
Reputation: 1,988

Post » Mon May 19, 2014 9:34 am

Even though I do not think Iframe embedding is a correct solution, if all the games are stored at the same domain, you could try to use the webstorage (session storage) to achieve that
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon May 19, 2014 9:54 am

spongehammer - what did you mean by "mini game"?

Aphrodite - what would be the best solution?
B
5
Posts: 24
Reputation: 280

Post » Mon May 19, 2014 3:27 pm

Did some research and while it's possible to use iframe the problem is that it would load the whole game engine basically twice, which could hurt performance, especially on mobile. So, I'll merge the two into one project.
B
8
S
2
Posts: 10
Reputation: 595


Return to How do I....?

Who is online

Users browsing this forum: Cubeeo and 18 guests