Double click with same actor

MarcoColMarcoCol Member, PRO Posts: 279

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 Member, PRO Posts: 2,782
    edited October 2017

    @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 Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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 Member, Sous Chef, PRO Posts: 2,879

    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.