Solved

DHTML quiz/game wanted

Posted on 2002-07-02
5
213 Views
Last Modified: 2011-09-20
Hi there...

need some help with DHTML code to create a small game.
Basically (at it's simplest), there will be 3 images down the left of the page...  A Fireman, A policeman, and A Doctor.  Then down the right of the page...  3 images... of the FireStation, the Hospital and the Police Station.

Now I want the images to be able to be dragged ontop of the relevant "matching image"... and when done correctly...  A big "well done" message or similar (and preferably the 2 relevant images moved off the 'playing area').  If the doctor is dragged onto the Fire Station... The "WRONG" message is displayed, and the image reset on screen for the user to try again....

Once all 3 pairs are matched up, a game over message is displayed...  

(I'm also looking for the whole thing to be timed, but this isn't as vital).

Any advice on similar sites, or even better, working examples of this type of game are required...

Thanks
Gary
0
Comment
Question by:garyennis
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:ckosloski
ID: 7127006
0
 
LVL 1

Author Comment

by:garyennis
ID: 7159557
OK... you're links were quite helpful and I've managed to put together a version of my game!!! (very simple mind you!)....

I need just a little bit of help to get the exact desired affect that I'm after....

You can download the files here:
www.scottisharchitecture.com/drag.zip

What I still want it to do (but haven't been able to achieve) is the following:

1) I cant get the doOverTarget() function to work....  (don't know why..)...  The doOutTarget() works fine...

2) Once the correct person is in the correct house (you'll see what I mean)... I want the dragEnabled property on the image to be turned off (so it can't be moved any more).

That's it....
Once I get the above 2 things sorted, I'll pay out the points!! (might even increase them too!!!)...

Thanks
Gary
0
 
LVL 4

Accepted Solution

by:
ckosloski earned 500 total points
ID: 7159829
1.  You are missing the ending quotes on the style attribute of the three divs (doctor, policeman, fireman).

2.Add this line after the good move alert to remove the dragEnabled attribute:
elDragged.removeAttribute("dragEnabled");

If you have any problems I can post the full code.

Corey

0
 
LVL 1

Author Comment

by:garyennis
ID: 7162595
Many thanks!!!!
You have sorted it for me!!!

Points increased!
0
 
LVL 1

Author Comment

by:garyennis
ID: 7953429
Don't suppose you could also answer the question I asked at:
http://www.experts-exchange.com/Web/Q_20487166.html

Thanks!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question