By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,643 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,643 IT Pros & Developers. It's quick & easy.

swf game mysql logic?

P: n/a
me
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+player1)=
10:11:2003:16:00: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
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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:
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+player1)=
10:11:2003:16:00: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


Jul 17 '05 #2

P: n/a
me
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" <Er**@Kincl.net_NO_SPAM_> wrote in message
news:3f******@news.gvsu.edu...
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:
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+player1)=
10:11:2003:16:00: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

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.