How do I Determine Click Order?

Get help using Construct 2

Post » Fri Sep 04, 2015 12:18 am

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,
B
19
S
3
Posts: 62
Reputation: 1,764

Post » Fri Sep 04, 2015 2:44 am

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.
Stuff I'm working on:



http://www.jamdonut.com
B
13
S
3
Posts: 88
Reputation: 1,025

Post » Fri Sep 04, 2015 2:46 am

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
Stuff I'm working on:



http://www.jamdonut.com
B
13
S
3
Posts: 88
Reputation: 1,025

Post » Fri Sep 04, 2015 7:39 am

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
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests