touch and vibrate

RUPASRUPAS Member Posts: 823
edited November -1 in Working with GS (Mac)
Hello family, how I can make an actor when touched vibrate like a guitar string?

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    Vibrate as in like the sound or as in like the picture?

    Sound; would be that you have to have it play a sound.

    Image you could do like;

    When touch is released;
    Animate.

    As far as getting the middle of an image to move while the ends stay stationary I'm not sure that can be done.
  • scribblstudiosscribblstudios Member Posts: 118
    Here's another solution, but its really impractical.

    Create tons of little actors to make up the string, and then put:
    When touch is pressed change attribute self position y (if horizontal setup, x if vertical) to self pos y- (touch x (or y if vertical)- self pos x), and the repeat this using a timer, except every other time use: change attribute self position y (if horizontal setup, x if vertical) to self pos y+ (touch x (or y if vertical)- self pos x).

    I doubt this is good for the FPS rate of your game but it might work. :)
  • DrGlickertDrGlickert Member Posts: 1,135
    scribblstudios said:
    Here's another solution, but its really impractical.

    Create tons of little actors to make up the string, and then put:
    When touch is pressed change attribute self position y (if horizontal setup, x if vertical) to self pos y- (touch x (or y if vertical)- self pos x), and the repeat this using a timer, except every other time use: change attribute self position y (if horizontal setup, x if vertical) to self pos y+ (touch x (or y if vertical)- self pos x).

    I doubt this is good for the FPS rate of your game but it might work. :)

    What's your definition of "tons of little actors"?
    Frame rate would be destroyed if you use "tons"
  • scribblstudiosscribblstudios Member Posts: 118
    Tons would be maybe 96 actors 5 pixels wide, for iphone.
Sign In or Register to comment.