How do I Determine Click Order?

0 favourites
  • 4 posts
From the Asset Store
Click! Click! 136 click sounds for your video games or media projects
  • I would like to know how best to determine that a group of sprites are clicked by a mouse in a particular order. Any help would be appreciated.

    Thanks,

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hard to explain easily without screenshots, but's here the technical answer in short if it helps:

    create a dictionary with keys set to the UID of the objects its possible to click, and set the dictionarys values to 0. When you click an object, you can check if they have what you want thats required to click it (i.e. GET from dictionary where UID is a different object already clicked OR check a global variable OR something else) and if thats successful, set the key to 1.

    Then the dictionary will be storing references for all the items that were clicked.

  • another way is this:

    on the objects that can be clicked, add an instance variable called "active" set it to 0.

    when the object is clicked, set "active" to 1.

    if it must check another object is active first do this:

    ObjectToCheck compare parameter "active" = 1

    then set ObjectClicked "active" to 1

  • or give each object a instance variable called "ivClickOrder" (number set to 0)

    set a global variable "gvNumberOfObjectsClicked" - number set to 0

    if object clicked

    and

    object.ivClickOrder=0

    then

    .................. : increase gvNumberOfObjectsClicked

    .................. : object.ivClickOrder=gvNumberOfObjectsClicked

    not tested - just an idea

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