How do I make a Drag and Drop with right or wrong system?

0 favourites
  • 5 posts
From the Asset Store
Be quick and choose whether the shown equation is right or wrong.
  • I need some help to make a drag and drop game where you need to put some objects in a shelf, each one of them has a specific place. If you put one in a wrong spot, you don't recive any points.

    I have no ideia how to make this "checking" if the object is in a wrong spot

    The image showing the idea

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The easiest method would be making the same animations structure in both sprites.

    In the Object sprite create animations "red", "blue", "green" - with 3 frames in each (circles "A", "B", "C").

    In the Spot sprite create the same animations also with three frames in each (squares "A", "B", "C").

    Then add this event:

    On Object drop
    Object Is Overlapping Spot
    	Object Is animation playing Spot.AnimationName
    	Object compare frame =Spot.AnimationFrame
    		-> display message "Correct spot"
    	Else
    		-> display message "Wrong spot"
    
  • Thanks dop2000

    I've forgot to ask if it is possible to recive the right or wrong answer only after putting all the objects in a place, so I can make the score system.

    Something like a "confirm" button that show your result after placing the objects

  • You can check all objects in a loop, for example:

    variable correctCounter=0
    For each Object
     Object Is Overlapping Spot
     Object Is animation playing Spot.AnimationName
     Object compare frame =Spot.AnimationFrame
    	-> Add 1 to correctCounter
    
    
    If correctCounter=Object.Count
    	-> display message "All objects correctly positioned"
    
  • dop2000 You're the best.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)