touch control help

joey2ejoey2e Member Posts: 99
edited November -1 in Working with GS (Mac)
Hello all

Have had a look through the tutorials and cant seem to find the answer to my problem:

My game requires the sprite to follow my finger once I select it,

so in essence I want to select the particular character by touching him/her, then the character to follow the trail I set out with my finger, the character would be unselected when I press the next character.

Any help on how to achieve this would be greatly appreciated

Joe

Comments

  • mediagraficamediagrafica Member Posts: 12
    Make an integer game attribute called like "character_select". Assign a value to every character. Add a rule to every character:

    - if actor is touched -> change attribute character_select = 1 (put here a different number for every character).

    In character #1 put a rule:

    - if game.character_select=1
    ---- acceletate toward -> set the values Positionx = device.mouse_position.x and Positiony = device.mouse_position.y, relative to scene.

    Of course you have to change the rule for every actor. i.e., for actor #2 it will be..
    - if game.character_select=2 etc etc.

    bye
Sign In or Register to comment.