Solved

DHTML quiz/game wanted

Posted on 2002-07-02
5
211 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 video teaches users how to migrate an existing Wordpress website to a new domain.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now