jen86
11-17-2007, 12:11 AM
Hi
I was just wondering if anyone could help with this!:)
I'm in the process of making a simple drag and drop game where the user has to drag images of teeth onto an image of gums,placing them in the correct positions (i know,sounds kind of weird,but its for an biology elearning piece!!:rolleyes: )
Anyway i have it working so that when the user places the tooth in the correct position,it remains there and a message saying "correct" appears. When positioned in the worng place, it goes back to its original position and a "Wrong" message appears.
Where i'm having trouble is once the tooth is placed in the correct place, it is still dragable and can be moved again. How do i get it to lock in that position??At the moment i'm using the followin piece of code:
on(press){
StartDrag(this,true);
}
on(release){
stopDrag();
if(_root.Leftincisor.hitTest(_root.target1)==true) {
_root.feedback.gotoAndPlay("correct");
}else{
setProperty(this,_x,128);
setProperty(this,_y,152);
_root.negfeedback.gotoAndPlay("wrong");
}
}
Also, I would like the game to also recognise when the user has positioned all the teeth correctly and perhaps play a "Well done!" message or something along those lines.
If anyone could help me with this, I would really appreciate it!!
Thanks!
Jen;)
I was just wondering if anyone could help with this!:)
I'm in the process of making a simple drag and drop game where the user has to drag images of teeth onto an image of gums,placing them in the correct positions (i know,sounds kind of weird,but its for an biology elearning piece!!:rolleyes: )
Anyway i have it working so that when the user places the tooth in the correct position,it remains there and a message saying "correct" appears. When positioned in the worng place, it goes back to its original position and a "Wrong" message appears.
Where i'm having trouble is once the tooth is placed in the correct place, it is still dragable and can be moved again. How do i get it to lock in that position??At the moment i'm using the followin piece of code:
on(press){
StartDrag(this,true);
}
on(release){
stopDrag();
if(_root.Leftincisor.hitTest(_root.target1)==true) {
_root.feedback.gotoAndPlay("correct");
}else{
setProperty(this,_x,128);
setProperty(this,_y,152);
_root.negfeedback.gotoAndPlay("wrong");
}
}
Also, I would like the game to also recognise when the user has positioned all the teeth correctly and perhaps play a "Well done!" message or something along those lines.
If anyone could help me with this, I would really appreciate it!!
Thanks!
Jen;)