GameSalad

Double click with same actor

MarcoColMarcoCol Posts: 228Member, PRO

There are a few tutorials in this forum, how to realize a double-click.

But I want to offer to the player the following in one actor:
if he click one time, the attribute should be attribute +1
if he make a double click, the attribute should be attribute -1

Maybe I didn't see the (easy) way to do it?!
Thank you.

Comments

  • HopscotchHopscotch Posts: 2,705Member, PRO
    edited October 2

    @MarcoCol

    can you explain more as to the actions to be performed for single and double click?

    Usually it is not good practice to implement mutually exclusive functions this way.

    A comfortable double click allows for a delay of half a second. So what should the system do after the first click, while it waits around for half a second to see if the user is going to double click or not?

    Waiting out the half second, and then only perform the single click action if no further click was performed, will feel laggy to the user.

    But maybe you have something totally different in mind where it may be acceptable.

  • tatiangtatiang Posts: 10,969Member, Sous Chef, PRO, Senior Sous-Chef

    I played around with this but ran into exactly what @Hopscotch is talking about. Clicking and waiting half a second (which is what I went with also) for a point feels so slow.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RThurmanRThurman Posts: 2,760Member, Sous Chef, PRO

    I think I get it. Try this:

    Rule: When touch is pressed  
      Rule: When [game.Time - self.OldClickTime] > [.5]  
        Change Attribute [self.PlusOrMinus] to [1]  
        Change Attribute [self.OldClickTime] to [game.Time]  
      Otherwise 
        Change Attribute [self.PlusOrMinus] to [-1]  
    
Sign In or Register to comment.