Rubbing with fingers gives off sound

0 favourites
  • 9 posts
From the Asset Store
75 explosion sound effects. Essential for many games, Explosions Sounds contains a mix of explosion and impact sounds.
  • I want to make a mechanism that sounds when rubbing a part of the screen with your finger

    ·No sound when I stop my finger

    ·Move your finger to make a sound

    I used [DragDrop is dragging].but this event is not good

    ·The sound keeps ringing without moving your finger.

    ·Sprite moves together

    Please give me some advice.

  • The problem is if you set something to play while you are touching the screen it will be triggered over and over as long as you touch the screen until you crash the sound card.

    You need a more specific trigger and a way to stop that sound after it has played.

    You could use a Y and X variable on the touch control for that trigger and I would check the acceleration of the drag. Keep the sounds short and add an auto stop so they don't overlap.

    On Y > 100: Play sound

    and X > 100

    and Touchacceleration >50

    On Y < 100: Stop all sound

    Or X < 100

    and Touchacceleration <50

    Every 3 seconds: Stop all sound

    Something like that.

    You could also use blank sprites as trigger points on your screen that when the user slides across changes the sound being played.

    Here is a CAPX for a continuous drag to change sounds using sprites:

    https://www.dropbox.com/s/dr7susdzqyatyg4/Sound%20Touch%20Control.capx?dl=0

  • The problem is if you set something to play while you are touching the screen it will be triggered over and over as long as you touch the screen until you crash the sound card.

    That is accurate.

    So simply use the condition "Sound is not playing" (right click the condition/Invert) from the audio plugin in your "rubbing" event to play the sound in loop.

    Event Rubbing

    • Sound is NOT playing => Play sound

    Event Stopped Rubbing

    • Sound is playing => Stop sound
  • Easier way to do this is using the "Is touching" and "Is in touch" conditions.

  • Easier way to do this is using the "Is touching" and "Is in touch" conditions.

    I think he wants the user to drag continuously changing the sounds?

  • thank you! lamar,Kyatric,MPPlantOfficial

    [quote:1tncz0gr]I think he wants the user to drag continuously changing the sounds?

    yes. i want use drag.

    I would like to try the following content, but I do not know what it is like.

    [Touchacceleration] is [orientation & motion] in the event?

    Sorry I do not understand well.....

    [quote:1tncz0gr]

    On Y > 100: Play sound

    and X > 100

    and Touchacceleration >50

    On Y < 100: Stop all sound

    Or X < 100

    and Touchacceleration <50

    Every 3 seconds: Stop all sound

  • Here is a CAPX using 3 sprites as touch controls showing how to do it with continuous touch drag:

    https://www.dropbox.com/s/dr7susdzqyatyg4/Sound%20Touch%20Control.capx?dl=0

    I may have a use for that later!

  • thank you lamar!!!!

    I am deeply moved and I'm about to cry

    I'll try!!!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you lamar!!!!

    I am deeply moved and I'm about to cry

    I'll try!!!!!

    LOL- well you don't need to go that far!

    You are welcome and that is something I can probably use in a future game.

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