Results 1 to 13 of 13
  1.    #1  
    folks, i know nothing of ajax. if i wanted to have a live game of pong between two players, would it be easy for someone to put together a quick app showing how this would be done. and/or what would be a good resource for learning the materials needed to do such?

    thanks!
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  2. #2  
    I don't think using AJAX would be fast enough for an interactive game. I'm using AJAX to get leaderboard information and it takes a second or 2. I'm sure there's another way. Maybe somebody else can clue us in.
  3. #3  
    The next version of Checkers Pro is expected to have Online Play. Although checkers isn't as fast-paced, it still is a step in the right direction.


    If I helped you or you have downloaded one of my files,
    then least you could do is click the "Thanks" button.
  4.    #4  
    Quote Originally Posted by Abyssul View Post
    The next version of Checkers Pro is expected to have Online Play. Although checkers isn't as fast-paced, it still is a step in the right direction.
    does it use ajax? would you be willing to share some code that i could learn from? thanks!
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  5. #5  
    Ask Jordan over at keen-studios.net


    If I helped you or you have downloaded one of my files,
    then least you could do is click the "Thanks" button.
  6. d.moss's Avatar
    Posts
    541 Posts
    Global Posts
    582 Global Posts
    #6  
    2 player pong would be bad *****
  7. #7  
    Quote Originally Posted by Abyssul View Post
    The next version of Checkers Pro is expected to have Online Play. Although checkers isn't as fast-paced, it still is a step in the right direction.
    Checkers and pong are 2 different things entirely. Any turn based game can be done with AJAX because the other player must wait for as long as it takes for the server to answer back. Pong and other interactive games require the exact position of the game element several times a second. This cannot be done using AJAX. You will have to connect to the server using some other method.
    mobigamedepot.com
  8.    #8  
    Quote Originally Posted by djpushplay View Post
    Checkers and pong are 2 different things entirely. Any turn based game can be done with AJAX because the other player must wait for as long as it takes for the server to answer back. Pong and other interactive games require the exact position of the game element several times a second. This cannot be done using AJAX. You will have to connect to the server using some other method.
    thanks for the info! when i come up with something turn-based i'll take a deeper look into it.
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  9. #9  
    Quote Originally Posted by shanerooni View Post
    does it use ajax? would you be willing to share some code that i could learn from? thanks!
    Here's some sample AJAX code for later when you need it:

    Code:
    	var request = new Ajax.Request(URL, {
    		method: 'get',
    		evalJSON: 'force', //to enforce parsing JSON if there is JSON response
    		onFailure: this.scoreHandleAjaxError.bind(this),
    		onSuccess: this.scoreGetResults.bind(this),
    	});
    Callback:
    Code:
    // normal callback from AJAX
    Assistant.prototype.getResults = function(transport){
    	try {
    	$("topspinner").mojo.stop();
    
    	var r = transport.responseJSON;
    	if ((typeof(r) === "undefined") || (r === null) || (typeof(r.error) === "undefined")) {
    // do some error checking in here
    Also error callback-

    Code:
    Assistant.prototype.handleAjaxError = function(event) {
        $("topspinner").mojo.stop();
        $("status").update("<font color='red'>Connection Error</font>");
    }
    mobigamedepot.com
  10. Qiller's Avatar
    Posts
    29 Posts
    Global Posts
    30 Global Posts
    #10  
    Until we get a websocket of similar technology in webOS, a better way to make faster paced games than turn-based could be to use some dedicated Comet server. Comet lets browser to establish semi-permanent connection to the server, which in turn can stream/push data back to the browser. I've used Meteor server for one of the iPhone projects, and latency was quite decent even over edge or 3g, 1 second or less. APE server 1.0 was just released and looks very promising too.
  11. #11  
    Bluetooth is how this type of thing is done on the iphone. I wonder if webos will ever support bluetooth connection between phones
  12. #12  
    Quote Originally Posted by Qiller View Post
    Until we get a websocket of similar technology in webOS, a better way to make faster paced games than turn-based could be to use some dedicated Comet server. Comet lets browser to establish semi-permanent connection to the server, which in turn can stream/push data back to the browser. I've used Meteor server for one of the iPhone projects, and latency was quite decent even over edge or 3g, 1 second or less. APE server 1.0 was just released and looks very promising too.
    For interactive games you need something like 50ms so 1 second would not work. Imagine a pong game where the paddle moves once a second.

    I wonder how the consoles do it in their multi-player games? (e.g. Xbox 360, PS3)
    mobigamedepot.com
  13. Qiller's Avatar
    Posts
    29 Posts
    Global Posts
    30 Global Posts
    #13  
    True, 500ms - 1 sec latency is not enough for very fast paced (ie shooter) games, but might be workable for something like MMO or strategy game.

    Consoles and PC games are completely different story, they have full access to native networking, TCP or UDP, instead of having to go through slow text-based HTTP request/response process...

Posting Permissions