Spawning Actor restricting the direction

greglevygreglevy Member, PRO Posts: 85
edited April 2012 in Working with GS (Mac)
Hi
I would like to restrict the direction when I spawn multiple actors in a row. Is this possible?

Thanks
Greg

Best Answers

  • tatiangtatiang Posts: 11,949
    edited April 2012 Accepted Answer
    @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.
  • tatiangtatiang Posts: 11,949
    Accepted Answer
    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.
  • tatiangtatiang Posts: 11,949
    Accepted Answer
    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.zip

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Can you explain what you mean by "restrict the direction?" Are you using multiple Spawn Actor behaviors, or a single behavior inside of a Rule/Timer?
  • greglevygreglevy Member, PRO Posts: 85
    I am spawning an actor to make a line. Similar to drawing a line with your finger. I would like the user to draw the line in one direction, following a pattern in a certain direction. My line works but the user can go either forward or backwards. I only want the user to go forward.

    Thanks
    Greg
  • greglevygreglevy Member, PRO Posts: 85
    THANKS!!!!!

    Greg
Sign In or Register to comment.