extension architecture

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
gringo
Posts: 16
Joined: 11 May 2007, 18:17

extension architecture

Post by gringo »

Hi, I was thinking: Writing a game is done by specifying a function which will be called every tick of the game, something like a 'WorldUpdate' function and every game I know works this way.

What is the idea on writing Smartfox server side games because we can write events only when an user send us something or either when an external event has happened (ie: user logs in / out) . How should we convert what is our idea on writing games (a function that is being called every x time) to this architecture?
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Post by Menser »

Hello-

You can still do what you want. Simply make use of Intervals. This will allow you to execute a function ever X amount of time.

_-Menser-_
alcho
Posts: 84
Joined: 02 Dec 2006, 19:37
Location: UK
Contact:

Post by alcho »

Yup, I would just make a call in the init function which starts an interval. This can act like an onEnterFrame of the interval you wish.

However I would make sure this is designed properly because I could image if many instances of this were running it could be slowing the server down with useless looping.
Its all about the SmartFox!
gringo
Posts: 16
Joined: 11 May 2007, 18:17

Post by gringo »

My question is exactly the other way round: how can I write a real time multiplayer game without doing that? And if I can, is it correct to think about it that way?
alcho
Posts: 84
Joined: 02 Dec 2006, 19:37
Location: UK
Contact:

Post by alcho »

Well the docs have some really good articles to answer that question. I would suggest you go through them properly and at the end you'll be the master of the Smart Fox!

Any advice I could give I'd be repeating whats in the docs. After looking at all the basic tutorials, Id suggest looking at the real time maze example in pro. The tutorials pretty much expain how to do any kind of game! :D
Its all about the SmartFox!
Post Reply