A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: 2 player game help please.

  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    9

    2 player game help please.

    is it possible to make a very very simple 2 player game with this assumptions :

    1. I have my own website but i cannot ask the hosting company to install something like socket servers or the electro server

    2. the game takes some parameters from the database and stores some game info there also

    3. the game will be turn based like a simple card game or chess game

    with point no. 1 set in stone, is it impossible? if it is not, what approach do i take which wouldnt be a totally ridiculous approach

  2. #2
    Senior Member Penleeki's Avatar
    Join Date
    Mar 2003
    Location
    England
    Posts
    223
    If you have access to php and mysql from your hosting company, then use them. Both are quite easy to learn, and work together to give you access to a single database online that you can use to make different players interact.

  3. #3
    Flash hates me. crashlanding's Avatar
    Join Date
    Nov 2003
    Location
    UK
    Posts
    439
    "wen i found my gerbil dead my other gerbil was eating it i just cried and screamed"
    http://www.livescripts.net

    --------------------------------------------------------------------------------
    Last edited by some moderator : Today at 9:01 PM.

  4. #4
    Ihoss
    Guest
    yup, you can either make a turnbased game that accesses PHP scripts or you can use msn ( http://games.mess.be ).

  5. #5
    Junior Member
    Join Date
    May 2004
    Posts
    9

    ok!

    ok thanks guys.. ill definitely look into it...

  6. #6
    Junior Member
    Join Date
    May 2004
    Posts
    9

    databse question

    by the way... i saw that php mysql is being recommended for my requirement... im currently using ASP with an ACCESS database.. would this be just the same thing? or is PHP better still a better option?

  7. #7
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    PHP/mySQL is just used more because those are free. But ASP/Acess should work too.

  8. #8
    Junior Member
    Join Date
    May 2004
    Posts
    9

    question

    hi guys.. ive been checking out the sites and sample you gave me... i understand most of em... theres one thing i cand find and understand though....

    i know LoadVariables() is used to get data from the database... but i can't seem to find the code that actually send them back to the asppage for insertion to the database!

    my question is.. how or what line of code is actually used for so that flash can send what i typed in back to the asp page?

  9. #9

  10. #10
    Ihoss
    Guest
    if you use php then you can put this script in the file you load with loadVariables():

    PHP Code:
    print("?_root.variable1=".$variable1."&variable2=".$variable2); 

    to send them to the php/asp page, you do this:
    code:

    loadVariables("myaspfile.asp?variable1="+variable1 +"&variable2="+variable2);


  11. #11
    free-webmaster-resource.com deamothul's Avatar
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    1,475
    I would use loadvars.sendAndLoad() for those things if i were you.
    loadVariables is older and loadVars is great

    here's an example with php.
    in the php file something like

    Code:
    $testVariable = $_POST['variableSendFromFlash'];
    print("&testData=$testVariable");
    Then in flash do something like this:
    Code:
    sendAndReceiveData = function(){
         sender = new LoadVars();
    
         sender.variableSendFromFlash = "hi send me to a php script";
         receiver = new LoadVars();
         receiver.onLoad = function(){
             myTextBoxName.text = receiver.testData;
         }
         sender.sendAndLoad("phpscript.php",receiver,"POST");
    }
    and call the php script on a button something like this:
    Code:
    myButton.onPress = function(){
    sendAndReceiveData()
    }
    straight outta my head, so don't expect it to work after a cut and paste but you should get the idea.
    Last edited by deamothul; 05-19-2004 at 09:26 AM.

  12. #12
    Junior Member
    Join Date
    May 2004
    Posts
    9

    sendandload

    from my current understand of sendandload()... is it correct to assume that if I use this, my approach no longer becomes polling? because i can get a response as soon as i send?

    no need to poll the db?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center