?
Solved

DHTML quiz/game wanted

Posted on 2002-07-02
5
Medium Priority
?
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
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 2000 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

771 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