开发者

What technology can be used for this browserbased ping-pong game?

I just saw the McDonald's commercial which I have linked to below and I would like to try developing something similar for a festival. We have been talking about making a game in which the user has to use their iPhone and something like what McDonald's 开发者_如何学Pythonhas done would be great.

My question is if anyone have an idea how I can send the data and what technology they might have used? I imagine making two websites. One on which the game itself is shown and one which is the controller but how would I make sure that the data is sent and handled fast enough?

I am familiar with JavaScript and PHP. I have been working a bit with flash and ActionScript and I am wondering if that might be best for the game (obviously not the controller)

You can see the McDonald's commercial on the link below. Basically, the user visits a webpage which is the controller and then they are able to play the ping-pong game on the big screen.

Any ideas and brainstorming on how to do this is welcome.

Watch the McDonald's Pick n Play commercial here.


Just use WebSockets. The problem with them is browser support and supporting older browsers / platforms.

To handle this there are various abstractions. I would personally recommend socket.io A solid abstraction that relies on node.js. Has a range of fallbacks (including COMET and Flash). Whilst your at it, you might want to looking into using node for realtime applications (it's great!)


I would create a socket server that hosts the game (socket TCP/IP connection). The purpose of the socket server application would be to listen for connections, wait for 2 players, start the game, decide who wins and sett-era (it could also have some queue of players that will play next and inform the players where they are in the queue).

Now, how do we establish a connection from the website to that socket server?

I wouldn't use WebSockets because it's not widely supported at the moment, disabled by default in FireFox and IE does not have it implemented yet (AFAIK).

Now you have to decide, do you want to do the website in Flash or HTML. You could even use hybrid of both. For example:

Hybrid: Use the Flash application on the controller website to act as the communicator between JavaScript and the server. When Flash retrieves data from the socket server then it will make JavaScript take care of the retrieved command. E.g. move pad up. (I use that method for my online chat application and it works like a charm).

Flash only: Use pure Flash application as the controller and communicator to the socket server.

Voila! You have something similar to the MacDonalds game.

I hope my answer is clear enough and feel free to comment if some of my statements are wrong.


In my view, This is what I would go for :

A small client app that will be downloaded when connected to the website.Considering it in mobile platform, java app preferably. Alternative is flash, which is also suitable, but if graphics is not our aim then I suppose better hold it off.

A server to provide real time connections to the users one-at-a-time. (As shown in video). This is the actual pain for all the games out there. I would go looking for one of these projects as platforms:

http://opensource.adobe.com/wiki/display/blazeds/BlazeDS

http://www.smartfoxserver.com/

http://www.cubeia.org/

http://appengine.google.com/

Besides that, ideas - I would have liked if it was multi player (there was quite a crowd), but that would have meant at least person winning every game & more of free give aways for them.


As alternative can be COMET a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it

have a look here: Comet

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜