Help with Memory Game

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
royrogersrevenge
Forum Newbie
Posts: 14
Joined: Fri Apr 06, 2007 9:57 pm

Help with Memory Game

Post by royrogersrevenge »

Hi everyone, I'm trying to take random images from a database I have and put them into a memory game. There would be 4 columns and 4 rows and everytime you click on a square, an image would appear. You would then click on another image and if they matched, the two images would both remain 'up', or if they did not match they would both be flipped back down. The game would be won when all pairs are matched. I'm quite new to php so, while I've tried a good bit with this, I haven't really gotten anything accomplished as I'm not entirely sure as to what I'm to do for much of this. Could anyone help me out with some advice or code to help me accomplish this?

Thanks,
Roy
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It would be more responsive if you did most of this project in Javascript.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I agree with feyd. This is really something that, just from a pure user experience standpoint, should be done client side.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

If you were going to implement this in PHP you would need to make use of sessions.
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post by impulse() »

I made this a while ago - http://stesbox.co.uk/new/games/oxo/

I know it's not exactly what you're looking for but I think it will get you most of the way.

Take note of the URLs for each square and let me know if you want to see the code.


Regards,
royrogersrevenge
Forum Newbie
Posts: 14
Joined: Fri Apr 06, 2007 9:57 pm

Post by royrogersrevenge »

Unfortunately I know very little about javascript and I'm afraid that it must be in PHP anyway as this is for a course I'm taking at school and this is the project my groupmembers chose(though it seems I'm doing all of the work :-\). Impulse, I would very much appreciate a look at your code as, while a different type of game, it seems to have several things in common with what i'm attempting to create.

Thanks,
Roy
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

How much PHP do you know Roy? I only ask because if you look closely at the way the links are laid out in that example, it should be somewhat straight forward how to implement it.
Post Reply