How do I change sprite colour depending on touch speed

0 favourites
  • 8 posts
From the Asset Store
Surena Touch
$2.50 USD
A wrap from official Touch plugin to export touch/mouse input to other plugins.
  • Hi everyone,

    Could be a really simple question but it has me stumped.

    I would like to change the colour of a sprite depending on how fast the user taps the screen.

    For example:

    no taps - white sprite

    lots of taps - red sprite

    I don't have a problem changing the colour of the sprite, but how can I measure the frequency of the users taps?

    Thanks!

  • Do this:

    System Event -> On every 0.5 seconds (for example) & Is Object being touched.

    If it misses one it will stay white. Change the timing to get he frequency that you need.

    Let me know if it works for you.

    Cheers!

  • Hi henriquesv,

    thanks for your advice - I just tried our your logic and it works - just not quite how I imagined it!

    What I am looking for is a little more open ended. By that I mean instead of targeting a specific touch frequency, I would like the sprite to change colour gradually as the user taps faster and faster.

    Any ideas?

    Thanks again for helping out!

  • Try this capx. You also have to remember to check if touch has been released... otherwise the player would cheat =)

  • Hummm I see... let me think about it!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could do this:

    Set the timer to minimum period (increase frequency) and count how many touches it gets in a larger amount of time.

  • For instance:

    Timer 1 (0.01s): check if the touch has been released and if it is touching. Add 1 to the counter.

    Timer 2 (0.5s): check how many touches happened and set this number to a color scale; clear counter;

    =)

  • Hi henriquesv,

    thank you very much for your help, that looks perfect!

    I will give that a try and let you know how I go (or if I need any more assistance =) .

    thanks again!

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