Spawning Actor restricting the direction
Hi
I would like to restrict the direction when I spawn multiple actors in a row. Is this possible?
Thanks
Greg
I would like to restrict the direction when I spawn multiple actors in a row. Is this possible?
Thanks
Greg
Best Answers
-
tatiang Posts: 11,949
@greglevy In your drawing area actor, have a rule that says When mouse is down --> change attribute game.LastX to game.Mouse.Position.X. Do the same for the Y values. Have another rule that says When touch is pressed AND game.Mouse.Position.X >= game.Last.X, spawn a dot at game.Mouse.Position.X/Y relative to scene; Otherwise [don't]. That will prevent the person from drawing to the left of their current position.
Okay, that's a good start, I think.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
tatiang Posts: 11,949
Okay, so my rules prevent you from drawing beyond the initial starting X position, but you can still make a u-turn and come back to where you started.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
tatiang Posts: 11,949
I added a rule to the drawing area actor and it seems to work pretty well: When touch is pressed AND game.Mouse.Position.X > game.LastX --> constrain attribute game.LastX to game.Mouse.Position.X... eh, let me just give you the file: http://dl.dropbox.com/u/19602014/Constraining Line Drawing Direction.zipNew to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks
Greg
Greg