Two node-webkit games accept input at same time?

Get help using Construct 2

Post » Tue Dec 17, 2013 1:10 am

Hi Everyone,

I made a one player game for a client, and now they are hoping to allow 2 players to play at the same time on one monitor. (Split-screen, but separate instances of the game that don't need to communicate with each other in any way)

I tried running multiple instances of the same game, and its tricky, but I can get that to work, BUT, only one window can be in focus and accept input.

Can anyone thing of a clever trick to get around this limitation...asside from remaking the game from scratch as split-screen?

thanks,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Tue Dec 17, 2013 1:16 am

This seems like a really weird request, and I've never seen any game that works like this. I don't know if the windows architecture even supports dual focus...
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,689

Post » Tue Dec 17, 2013 1:29 am

First thing that crossed my mind:

Maybe try to listen on the input on one instance of the game (the focused one) and pass the player2 commands to the other, un-focused instance?


If the player 2 game is rendering although it's not focused (and i'm pretty sure it will) maybe you could hack something up.

You can try to spawn/fork player2 game as a child process and using child.send(message) make them communicate.

Be nice until it's time to not be nice
B
36
S
10
G
9
Posts: 293
Reputation: 6,712

Post » Tue Dec 17, 2013 1:39 am

Hi JohnnySheffield,

Is any of this possible through C2? If so what objects (plug-ins) are required etc?

thanks.
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Tue Dec 17, 2013 1:50 am

I'm afraid not, you'd have to write custom plugin/s, or "external" nodejs code to handle spawning and communications.
Be nice until it's time to not be nice
B
36
S
10
G
9
Posts: 293
Reputation: 6,712

Post » Tue Dec 17, 2013 8:02 am

I was hoping for maybe some way to run each instance of the game as a sub-app in one app that kinda "holds them together"...but no luck so far.

Thanks for the suggestions everyone.

cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 14 guests