Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by icydee

Most of the examples I have seen have been stand-alone games that run in the browser, I have not seen any that communicate state with a server.

What is the best practice for this? (I am familar with AJAX calls etc. that's not the problem)

I mean, I don't think I should be making the call in the main event loop, it's just too time expensive.

So, I presume I need some code that is outside of the event loop, the event loop communicates to this level through the DOM? A worked example would help here if anyone knows?

icydee

1 decade ago by Joncom

The idea is that you only send updates when a change occurs.

For example, if you have a game where a bunch of people are walking around a level, then you would update the position of the each entity only when it: A) starts moving, B) stops moving, or C) changes direction.

You're right, this would not happen in the main loop.

I can't see why there's anything wrong with having your entities send they own updates to the server.

If you've done AJAX calls before, then working with sockets will feel somewhat familiar.

I found these tutorials very useful when I first got started!
Page 1 of 1
« first « previous next › last »