touch control question...

goliathgoliath Member Posts: 1,440
edited November -1 in Working with GS (Mac)
Ok guys, thanks for being patient with me for the last 2 days....

As of right now, in my gamesalad viewer, if you press the up arrow, my ship flies up. if you press down the ship flies down ETC.

I am wondering what is the easiest way to convert the touch controls for use on the iphone and ipod touch?

Basically I want my ship to fly around with the touch of your finger. Right now it just flies randomly....
«1

Comments

  • goliathgoliath Member Posts: 1,440
    no one huh?
  • chosenonestudioschosenonestudios Member Posts: 1,714
    this is the easiest.... not necessarily the best..... actually not the best....

    create 4 actors, an up actor, a down actor etc. put them on your screen and when up is pressed go up and do the same for the other ones... and instead of when key is pressed... make it when touch is pressed...

    I think thats what you meant!

    Good LucK! :D
  • goliathgoliath Member Posts: 1,440
    What i want to do is i want a player to click and drag the ship all around the screen.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    oh... do that like this:

    when touch is pressed:

    constrain self.position.x to mouse position.x
    constrain self.position.y to mouse position.y
  • goliathgoliath Member Posts: 1,440
    trying it now...

    thanks
  • chosenonestudioschosenonestudios Member Posts: 1,714
    goliath said:
    trying it now...

    thanks

    Yep :)

    Good Luck!
  • goliathgoliath Member Posts: 1,440
    stupid question..... type in the words "mouse position x"
  • goliathgoliath Member Posts: 1,440
    never mind.... i think i got it.... ill let you know if it worked!
  • goliathgoliath Member Posts: 1,440
    hmmm... didnt work...
  • chosenonestudioschosenonestudios Member Posts: 1,714
    I just created a new project and tried that.... just to make sure it works.... and it does...

    did you enter it EXACTLY like this?:

    when touch is pressed:

    constrain self.position.x to game.mouse.position.x
    constrain self.position.y to game.mouse.position.y

    Edit: Oh yeah... make sure you add this in the actor you want to move around...

    Good Luck! :D
  • quantumsheepquantumsheep Member Posts: 8,188
    Make sure you don't write out the words 'mouse.position.x' but select it by clicking the 'e' button (for expression) then use the left hand drop down menu and pick devices, mouse position, X
  • goliathgoliath Member Posts: 1,440
    trying it again....maybe i missed something...
  • chosenonestudioschosenonestudios Member Posts: 1,714
    goliath said:
    trying it again....maybe i missed something...

    aight, let us know if you get it :D
  • goliathgoliath Member Posts: 1,440
    nope....LOL! I don't know..

    basically the ship keep jumping around like crazy and its not smooth at all and doesn't follow my finger...
  • chosenonestudioschosenonestudios Member Posts: 1,714
    hang on.. I'll upload a project real fast...
  • goliathgoliath Member Posts: 1,440
    remind me to save you guys some promo codes
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Here you are :D

    http://gamesalad.com/game/play/60995

    Hope this helps!

    Good Luck!
  • goliathgoliath Member Posts: 1,440
    thats exactly what i want to do...
  • chosenonestudioschosenonestudios Member Posts: 1,714
    download the project :)

    Good Luck!
  • goliathgoliath Member Posts: 1,440
    i clicked on download.....where does it download..... I am very sorry for the noob question and i truly appreciate your help
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Don't worry about it :)

    You can download it like that, but its kinda a pain in the butt....

    What I do is... Open up GS hit shared projects and click on the little pencil on the one that says For Goliath (Follow Mouse)
  • goliathgoliath Member Posts: 1,440
    found it.... ill keep you updated
  • chosenonestudioschosenonestudios Member Posts: 1,714
    goliath said:
    found it.... ill keep you updated

    aight
  • goliathgoliath Member Posts: 1,440
    its still going crazy for some reason.... no idea why...

    thanks again for all of the help... ill try again tomorrow
  • chosenonestudioschosenonestudios Member Posts: 1,714
    goliath said:
    its still going crazy for some reason.... no idea why...

    it probably has something to with receiving mixed commands.....

    Is there any other movements that are triggered when you click on it?

    Anyway, yeah I'm going to bed also.... I have to get up for work in 4 hours haha

    Sooo..... just continue posting whats going on, on this thread and I'll see if I can help you tomorrow :D

    Aight night
  • goliathgoliath Member Posts: 1,440
    Its still going crazy for some reason. I took off the previous movement that we had to test on the computer (when user presses up arrow, ship moves up) and just went with the touch movement and the ship is still going all over the place....

    I just don't get it...
  • ZackGSZackGS Member Posts: 313
    You don't assign it to mousex/y for touches. You assign it to (for instance) touch1 x and touch1 y (it's located under the devices category)

    and have it triggered on a pressed/touched event. That way it will only follow your finger whilst your finger is touching the ship.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    danny_iphone said:
    You don't assign it to mousex/y for touches. You assign it to (for instance) touch1 x and touch1 y (it's located under the devices category)

    You can use mouse position x and y..... and it does work... see demo here

    http://gamesalad.com/game/play/60995
    danny_iphone said:
    and have it triggered on a pressed/touched event. That way it will only follow your finger whilst your finger is touching the ship.

    This method also produces that.....

    @Goliath, yes you can try this method, but if you have any kind of multitouching i.e. using two fingers it won't work either (yea if you cant get that to work.. try this method)

    Good Luck!

    @danny theres more than one way to do everything... and the way i said does work... no need to blatantly say it doesn't.... Its probably just not working because there are some overlapping rules...
  • ZackGSZackGS Member Posts: 313
    chosenonestudios said:

    @danny theres more than one way to do everything... and the way i said does work... no need to blatantly say it doesn't.... Its probably just not working because there are some overlapping rules...

    My mistake, sorry about that!
  • chosenonestudioschosenonestudios Member Posts: 1,714
    danny_iphone said:
    My mistake, sorry about that!

    Don't worry about it :D
Sign In or Register to comment.