How do you prevent your actor teleporting everytime you touch a certain x,y?

muchwowappsmuchwowapps Member Posts: 9
edited February 2015 in Working with GS (Mac)

Hi there, my current screen has a "touch area"( bottom half of the screen) while my actor moves on the top part of the screen (another half of the screen) so everytime you touch the "touch area" the actor also moves the same way,

My question is, is there a way that my actor will not reset his x,y if I touch somewhere in my touch area? I just want him to stay his position and continue his movement if I continue again to hold in my touch area.

Thanks!

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    You question is a little confusing, it is basically . . . .

    I want to be able to lift my finger up and place it somewhere else and the actor should not jump to this position but will still move when I then drag my finger ?

  • muchwowappsmuchwowapps Member Posts: 9
    edited February 2015

    @Socks said:
    You question is a little confusing, it is basically . . . .

    I want to be able to lift my finger up and place it somewhere else and the actor should not jump to this position but will still move when I then drag my finger ?

    Hey sorry for my explanation, YEP that's right!
    I want my character to stay to his last position but when I click my mouse somwhere in the touch area it teleports his position

    Thanks!

  • muchwowappsmuchwowapps Member Posts: 9
    edited February 2015

    More like "Insanity!" app controls :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @muchwowapps said:
    Thanks!

    Create two 'real' attributes in the actor, let's call them OffsetX and OffsetY

    Rule:

    When mouse button is down . . . .

    Change OffsetX to game.Mouse.Position.X-self.Position.X
    Change OffsetY to game.Mouse.Position.Y-self.Position.Y

    Constrain Self.Position.X to . . .
    max(0,min(game.Display Size.Width,(game.Mouse.Position.X-self.OffsetX)))

    Constrain Self.Position.Y to . . .
    max(game.Display Size.Height/2,min(game.Display Size.Height,(game.Mouse.Position.Y-self.OffsetY)))

    . . . . hold on, let me make a quick demo file . . .

  • SocksSocks London, UK.Member Posts: 12,822

    Example file attached . . . .

  • muchwowappsmuchwowapps Member Posts: 9

    @Socks said:
    . . . . hold on, let me make a quick demo file . . .

    Thank You So Much!! Gonna put your name on credits after I finish this game. :smiley:

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @muchwowapps said:
    Thank You So Much!! Gonna put your name on credits after I finish this game. :smiley:

    Please don't ! :) People might not want to have their names associated with all sorts of projects that have nothing to do with them just for helping out, no disrespect to you (your game could be great for all I know !! I've not seen it after all) I'd just rather not be associated with various things out of my control, someone (not you) could use a tip or demo on some terrible project and I get myself associated with it !

    I hope you understand.

  • muchwowappsmuchwowapps Member Posts: 9

    @Socks said:
    Please don't ! :) People might not want to have their names associated with all sorts of projects that have nothing to do with them just for helping out, no disrespect to you (your game could be great for all I know !! I've not seen it after all) I'd just rather not be associated with various things out of my control, someone (not you) could use a tip or demo on some terrible project and I get myself associated with it. I hope you understand.

    Lol! Sure sure! sorry for that! :smiley: I'm actually doing this secretly and against my job that's why I'm using this name. I'm just preparing for my future when I get out of my current company. lol.

    Anyway Thanks! :smiley:

  • SocksSocks London, UK.Member Posts: 12,822

    @muchwowapps said:
    Lol! Sure sure! sorry for that!

    No problem at all, just making sure I don't get listed on a bunch of stuff that don't have much to do with me.

    Good luck ! :smile:

  • LovejoyLovejoy Member Posts: 2,078

    @Socks said:

    I have a few dozen flappy bird clones with you name on it.

    Fortuna Infortuna Forti Una

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @Lovejoy said:
    I have a few dozen flappy bird clones with you name on it.

    Only a few dozen ?

    :(

Sign In or Register to comment.