Solved

DHTML quiz/game wanted

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

737 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