Two node-webkit games accept input at same time?

  • 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

  • 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...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Hi JohnnySheffield,

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

    thanks.

    Mike

  • I'm afraid not, you'd have to write custom plugin/s, or "external" nodejs code to handle spawning and communications.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)