Ensuring Draggable Actors Don't Go Outside Area...

delorianhayzedelorianhayze Member Posts: 55
edited November -1 in Working with GS (Mac)
Hey all,
curious if you can figure out a way to ensure that a (click and drag) actor doesn't either leave the scene and or a desired area of the game. I've set up my collisions and invisible walls but I'm finding that if the user keeps at it, eventually they'll be able to click and drag the actor through the area.
I just tried something that sort of works but know you all can do much better. Any thoughts?
I tried saying basically, when actor hits Invisible Wall, change self position attribute (x and Y)-40.
That only works on some angles though. I think I have the right idea, but just missing it sligthly.
Thanks!

Comments

  • delorianhayzedelorianhayze Member Posts: 55
    Very very close.
    But here are a few potentially minor problems and questions.
    1.) I need my actor to rotate. Meaning, that when it hits an object it can be pushed (or nudged). Like a plank object gliding/hitting across an angle, it will rotate accordingly as it's pushed harder against it.
    2.) My actor has "coding" attached to it so that it drags exactly at the point where the user taps it. In this example the object "snaps" to the center of the object. I'm not sure if that presents any potential problems.
    3.) I noticed you put the number "60" next to the "touch distance" of the actor "bomb." Curious what that means?

    Otherwise it worked beautifully and I can't thank you enough for the help.
    If this doesn't work out, is there a way for me to just say something like...
    "when actor hits object change its position to x amount of pixels in the opposite direction"?
    Easier said than done as I have no idea how to input those commands into GS.

    Thanks again!
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    delorianhayze said:
    Very very close.
    But here are a few potentially minor problems and questions.
    1.) I need my actor to rotate. Meaning, that when it hits an object it can be pushed (or nudged). Like a plank object gliding/hitting across an angle, it will rotate accordingly as it's pushed harder against it.
    2.) My actor has "coding" attached to it so that it drags exactly at the point where the user taps it. In this example the object "snaps" to the center of the object. I'm not sure if that presents any potential problems.
    3.) I noticed you put the number "60" next to the "touch distance" of the actor "bomb." Curious what that means?

    Otherwise it worked beautifully and I can't thank you enough for the help.
    If this doesn't work out, is there a way for me to just say something like...
    "when actor hits object change its position to x amount of pixels in the opposite direction"?
    Easier said than done as I have no idea how to input those commands into GS.

    Thanks again!

    Sounds like you should set up collision walls and use TSB's maze system.
  • delorianhayzedelorianhayze Member Posts: 55
    This maze system uses a mouse draggable actor?
    If so can you point me in the direction of this tutorial?
    Thanks!
  • delorianhayzedelorianhayze Member Posts: 55
    Is there a way for me to just say something like...
    "when actor hits object change its position to x amount of pixels in the opposite direction"?
    I imagine this might be slightly difficult as there has to be a way for the computer to figure out which direction you were going in (and on all angles).
    Any help as always much obliged!
    Thanks!
Sign In or Register to comment.