473,508 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

swf game mysql logic?

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
2 3252
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6250
by: mdh | last post by:
I am trying to learn the basics of MVC applications using a Tomcat infrastructure. I'm starting by building a simple application with: * a login.jsp page for a basic login form with a action...
2
2475
by: DaMan | last post by:
Can anyone recommend a good book that teaches how to program basic games in C++? I have some C and C++ experience, but not too much with graphics. The kind of game I want to write is a simple...
138
6404
by: theodp | last post by:
--> From http://www.techdirt.com/articles/20040406/1349225.shtml Microsoft Patents Saving The Name Of A Game Contributed by Mike on Tuesday, April 6th, 2004 @ 01:49PM from the...
11
2526
by: enki | last post by:
I am writing a game and I am having trouble with moving the character on the map. Here is what I have right now. It involves win32 programming but that not my problem. I would like some...
15
4450
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
1
2660
by: Jos | last post by:
Hello all. I have a working server, using the asyncore/chat module, which enables logging in, rooms and private messaging. I've used this framework to make some simple games that only required...
1
1896
by: DaRueSchni | last post by:
Hello, I am a student who needs to develop a game for an XDA. I´d like to create one where you need to walk through some floors and enter different rooms. (walk through floors maybe like 1st...
0
1684
by: Madmartigan | last post by:
Hi I'm a newbie to C# and have been instructed to create a Hangman game in SharpDevelop. I don't want the answer to the full code, just some help along the way. I have included my code thus...
7
1801
by: sathyashrayan | last post by:
Dear group, A mysql wrapper class, which just uses the CRUD operations for large scale php development. Is the same advisable for the mysql stored procedure? Following is a link I got from...
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.