Is there a way to keep collide rules in effect WHILE you drag an actor with your finger? While dragging I can make the actor go right through the floors and walls as it is.
I'm sure there should be a better system but what I do is create a integer that will be changed to 0 when touched and 1 when released. Then a rule that says when that integer is 1 nothing happen, but in the otherwise section I put the constrains. Last rule is when actor collides with a wall change attribute to 1. EDIT: I am even slower, there is the better method! http://gshelper.com/?p=377
LOL, this is even better than I expected, I was on GS helper trying to use MIN,MAX video to accommodate this need. I didn't notice this video though. Thank you guys! Is it possible to use a min max without the mouse position in it, for example you just want a box moving around by itself without leaving the screen, but without using walls. basically giving it a min,max position constraint which is always in effect.
Yeah you can do that , you can tell your box that: if its X value is above 480 , constraint its x to 480 if its X value is below 0 , constraint its x to 0 if its Y value is above 320 , constraint its Y to 320 if its Y value is below 0 , constraint its Y to 0
I would however suggest simply make a border actor (unmovable) and place it around the scene then tell your boxes to collide with it .
Wow you guys are quick, this isn't a race now! Thanks, I will give this a shot. I just thought using another four actors would be heavier than having the position rules.
Comments
http://gshelper.com/?p=377
Roy.
http://gshelper.com/?p=377
(You would replace the mouse position stuff with touch position.)
EDIT: Ohh.. you gotta be fast around here! P-O-M beat me to it!
Roy.
Then a rule that says when that integer is 1 nothing happen, but in the otherwise section I put the constrains.
Last rule is when actor collides with a wall change attribute to 1.
EDIT: I am even slower, there is the better method!
http://gshelper.com/?p=377
RThurman
you can tell your box that:
if its X value is above 480 , constraint its x to 480
if its X value is below 0 , constraint its x to 0
if its Y value is above 320 , constraint its Y to 320
if its Y value is below 0 , constraint its Y to 0
I would however suggest simply make a border actor (unmovable) and place it around the scene
then tell your boxes to collide with it .
Cheers
Roy.
You are right , I'm sorry , i didn't noticed i was so young
Roy.
Tempus Fugit
RThurman
then tell your boxes to collide with it ."
This doesn't work, you can still drag an actor through walls, even with a collide behaviour.