problem with reverse constrain position and max position
hi guys,
I'm trying to create a rectangle the constrain the position to the mouse and also constrain to a min and a max position of the screen and it works great.
now I created a "special" power up that reverse this control. when the player drag left, the rectangle go right with a special expression. I added the expression for the min and the max position but now this two expression when the power up is activated don't work!
here is a screenshot of the rules for the special power up:
![image](http://img198.imageshack.us/img198/5199/schermata072456116alle0.png)
cheers and thanks and i hope you understand my problem
I'm trying to create a rectangle the constrain the position to the mouse and also constrain to a min and a max position of the screen and it works great.
now I created a "special" power up that reverse this control. when the player drag left, the rectangle go right with a special expression. I added the expression for the min and the max position but now this two expression when the power up is activated don't work!
here is a screenshot of the rules for the special power up:
![image](http://img198.imageshack.us/img198/5199/schermata072456116alle0.png)
cheers and thanks and i hope you understand my problem
![:D :D](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/grin.png)
Best Answer
-
gyroscope I am here.Posts: 6,598
@patapple
I think I get why you're after... as far as I can make out from your screenshot, you're constraining self.position.x, then immediately constraining it again with a different equation; making the first equation redundant.... any help?""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
then when a specific attribute is activated i want the this control now are reverse (this works fine)
the problem is that there is an expression to limit the constrain to a certain position but the same rule in the reverse constrain doesn't work.
do you understand the problem?
Oh, silly me, my mistake; :P – I see now, you're putting two different types of constraints onto self.Position.X which is fine, of course.
Could you post the other version please? I'd like to compare them to see if I can help out.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
this is the normal one:
and this is the reverse one:
Hi again,
it's great you've got this first one working; I've been scratching my head over the 2nd constrain equations in each case, where it seems you've put a min expression as the y value of the max. I really can't work that one out! (Perhaps I'm being slow today...) But hey, if it's working for you, then great!
The second one, that's not working, I think it's because: say the actor drags left, the rectangle moves right only until the rule When touch is pressed is valid; as soon as it gets outside of the touch drag, it no longer works.... hope I've explained that OK....
For the opposite that you want, maybe put When game.inverse is true etc without the when touch is pressed rule.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I'll try again in a sec....
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Hi again, I must be a bit slow today when it comes to your limiting equations in each case: I've been scratching my head trying to understand why you've the min expression as the y value in the max expression (I must be slow today... ;-) ) but, hey, as long as it's working for you!!
For your prob, I think it's because of the When touch is pressed Rule: as soon as the rectangle moves opposite to the touch drag and is no longer under the touch, then it won't work.
So try removing the touch rule in that case, just have: When game.inverted is true, etc.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps