0
\$\begingroup\$

I want to create a client-server game that runs on Game Maker HTML5-NodeJS. The NodeJS server will be an AI server - a bot that acts like a human opponent and plays against the human player at a front-end game client that is coded in GM HTML5.

How can a NodeJS server be used from GM HTML5. Are there any examples of such a system?

I already got an iOS game that can talk to a remote AI server (coded in Lua) using TCP sockets. Can this be done with Game Maker HTML5 and NodeJS.

\$\endgroup\$
0
1
\$\begingroup\$

Game Maker HTML5 is supposed to have an "Internal code editor with user definable syntax colouring". So if you're able to write some Javascript on the client side, you can use socket.io. It's a node.js module that does WebSockets and way more, and it's really easy to use.

\$\endgroup\$
1
\$\begingroup\$

If you can modify the generated HTML5, then yes, of course it can.

For communication, use socket.io, it's a great library that I've used to make a simple MMO (dev blog: http://yannbane.blogspot.com/).

You can find great examples on their site: http://socket.io/.

To install socket.io, you must do:

npm install socket.io

To use it on server-side:

var io = require('socket.io');

And on client-side:

<script src="/socket.io/socket.io.js"></script>

\$\endgroup\$
1
  • 1
    \$\begingroup\$ note, not all browsers support websockets (IE) but socket.io counters this problem. \$\endgroup\$ – Thomas Jun 28 '12 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.