How do you prevent your actor teleporting everytime you touch a certain x,y?
muchwowapps
Member Posts: 9
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
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!
More like "Insanity!" app controls
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 . . .
Example file attached . . . .
Thank You So Much!! Gonna put your name on credits after I finish this game.
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! 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!
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 !
I have a few dozen flappy bird clones with you name on it.
Fortuna Infortuna Forti Una
Only a few dozen ?