swf game mysql logic?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • me

    swf game mysql logic?

    Hey all,

    I am making a 4 in a row game in flash MX.

    Wel i do it a bit pimitief like sending respons from the swf file to the
    php-mysql handler to see if the other user has make a move.

    I ask for some guidenes i am new on this.

    i thougth to make 3 tables

    one table 4rowsession 4 fields
    -gameid
    -user
    -userid
    -date+time

    When the first time the game starts i send the beginer player
    name+(date+time +);
    i send back the game session id (date+time+play er1)=
    10:11:2003:16:0 0:00PLAYER1
    this is the unice game id that the other user must log in too so that the
    game swf know wich player the oppement is.

    then other table 4rowpalyers
    -gameid
    -user
    -moves (must contain all the moves) or must i make 23 fields with move1
    move2 move3 ??

    the other tables i am not sure..

    maybe this is very simple.. but i want the swfgame to see if the other user
    has responed in 1 minute, to see what the other player move is from the
    database

    Cheers, m


  • Eric Kincl

    #2
    Re: swf game mysql logic?

    Hey,
    From what I can gather, you want to keep track of users and games... Here
    is how I would do it. (this follows 1st, 2nd, 3rd normal form.)

    A couple of tables: First a simple user table:
    -userID
    -username
    -any other user-specific info, W/L record maybe?

    A games table:
    -gameID
    -user1ID
    -user2ID
    -turn (whos turn it is (ID))
    -time (time game has been lasting for)
    -One of 2 ways for storing the gamedata...
    either:
    -1x1
    -1x2
    -2x1
    -etc, and store who is in each spot
    --OR--
    -moves
    you would have to make some extra functions for this. You want an array
    which stores the moves (moves[0] = first move, move[1] = seconds move
    etc...) You would have to create functions to put the array into/take the
    array out of the database...

    There may be a way of joining tables nicely to make the "moves" field easier
    to deal with... I just don't know it right now.


    -Eric Kincl


    me wrote:
    [color=blue]
    > Hey all,
    >
    > I am making a 4 in a row game in flash MX.
    >
    > Wel i do it a bit pimitief like sending respons from the swf file to the
    > php-mysql handler to see if the other user has make a move.
    >
    > I ask for some guidenes i am new on this.
    >
    > i thougth to make 3 tables
    >
    > one table 4rowsession 4 fields
    > -gameid
    > -user
    > -userid
    > -date+time
    >
    > When the first time the game starts i send the beginer player
    > name+(date+time +);
    > i send back the game session id (date+time+play er1)=
    > 10:11:2003:16:0 0:00PLAYER1
    > this is the unice game id that the other user must log in too so that the
    > game swf know wich player the oppement is.
    >
    > then other table 4rowpalyers
    > -gameid
    > -user
    > -moves (must contain all the moves) or must i make 23 fields with move1
    > move2 move3 ??
    >
    > the other tables i am not sure..
    >
    > maybe this is very simple.. but i want the swfgame to see if the other
    > user has responed in 1 minute, to see what the other player move is from
    > the database
    >
    > Cheers, m[/color]

    Comment

    • me

      #3
      Re: swf game mysql logic?

      Thanks Eric,

      i was thinking the same way and i tought maybe for the moves i do this:
      moves:
      "1,3,2,4,5,2,4, 6,7,7" = string and then laters split(",") to a array?

      Cheers,
      M
      "Eric Kincl" <Eric@Kincl.net _NO_SPAM_> wrote in message
      news:3fafd9a9@n ews.gvsu.edu...[color=blue]
      > Hey,
      > From what I can gather, you want to keep track of users and games... Here
      > is how I would do it. (this follows 1st, 2nd, 3rd normal form.)
      >
      > A couple of tables: First a simple user table:
      > -userID
      > -username
      > -any other user-specific info, W/L record maybe?
      >
      > A games table:
      > -gameID
      > -user1ID
      > -user2ID
      > -turn (whos turn it is (ID))
      > -time (time game has been lasting for)
      > -One of 2 ways for storing the gamedata...
      > either:
      > -1x1
      > -1x2
      > -2x1
      > -etc, and store who is in each spot
      > --OR--
      > -moves
      > you would have to make some extra functions for this. You want an[/color]
      array[color=blue]
      > which stores the moves (moves[0] = first move, move[1] = seconds move
      > etc...) You would have to create functions to put the array into/take the
      > array out of the database...
      >
      > There may be a way of joining tables nicely to make the "moves" field[/color]
      easier[color=blue]
      > to deal with... I just don't know it right now.
      >
      >
      > -Eric Kincl
      >
      >
      > me wrote:
      >[color=green]
      > > Hey all,
      > >
      > > I am making a 4 in a row game in flash MX.
      > >
      > > Wel i do it a bit pimitief like sending respons from the swf file to the
      > > php-mysql handler to see if the other user has make a move.
      > >
      > > I ask for some guidenes i am new on this.
      > >
      > > i thougth to make 3 tables
      > >
      > > one table 4rowsession 4 fields
      > > -gameid
      > > -user
      > > -userid
      > > -date+time
      > >
      > > When the first time the game starts i send the beginer player
      > > name+(date+time +);
      > > i send back the game session id (date+time+play er1)=
      > > 10:11:2003:16:0 0:00PLAYER1
      > > this is the unice game id that the other user must log in too so that[/color][/color]
      the[color=blue][color=green]
      > > game swf know wich player the oppement is.
      > >
      > > then other table 4rowpalyers
      > > -gameid
      > > -user
      > > -moves (must contain all the moves) or must i make 23 fields with move1
      > > move2 move3 ??
      > >
      > > the other tables i am not sure..
      > >
      > > maybe this is very simple.. but i want the swfgame to see if the other
      > > user has responed in 1 minute, to see what the other player move is from
      > > the database
      > >
      > > Cheers, m[/color]
      >[/color]


      Comment

      Working...