how to limit constrain?
hi all, right now i have a actor that constrain x and y position to mouse position, but let say i don't want my actor to keep moving when x position is less than 50, this work when my actor reach x=50 so it won't keep moving left but i can't move right either.
Answers
When touch is pressed
-constrain self.position.x to max((50+( self.Size.Width /2)), game.Mouse.Position.X )
constrain attribute self.position.x to max((50+( self.Size.Height /2)),min((100-( self.Size.Width /2)), game.Mouse.Position.X ))
replace the 100 with whatever you want