Skip to main content
Participating Frequently
January 11, 2017
Question

score counter in drag and drop game

  • January 11, 2017
  • 1 reply
  • 2122 views

i want to make a drag and drop flash game using AS3. i want each correct dropped item to worth one point and after the learner makes the series of drops and clicks "submit" , his score will show at the end. how to make the score counter in that case?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
January 11, 2017

create a variable whose value records the score:

var score:int = 0; // initialize

and in your drop functions:

if(whatever dropTarget == expected target){

score++;

}

function submit_listener(e:MouseEvent):void{

score_tf.text="your score is "+score.toString();

}

Participating Frequently
January 14, 2017

i want the answer in more details because i am a beginner

kglad
Community Expert
Community Expert
January 14, 2017

copy and paste the listener function called when objects are dropped.