Page 1 of 1

connecting actors

PostPosted: Wed Jun 17, 2009 9:53 pm
by MrB
I have been fiddling with GE for a few days now and have managed to play with some basics, balls bouncing and speeding up and so on but what I really want to do is make a construction game.

What would be the easiest way to connect 2 actors together so that when they are picked up with the mouse they will all move as one object?

Re: connecting actors

PostPosted: Wed Jun 17, 2009 10:25 pm
by skydereign
Is this what you wanted? If they actually are connected then you can use parent and collide. I can explain other methods if you still don't get it, or if this is not what you wanted.
http://game-editor.com/forum/viewtopic.php?f=1&t=6450

You could also have an actor variable connected, and set it to a variable. Then have a global variable, called selected. In the draw of your actors;
Any->DrawActor->Script Editor
Code: Select all
if(connected==selected)
{
    FollowMouse("Event Actor", BOTH_AXIS);
}


Then when you click an actor, it sets selected to the actor's connected.
Any->MouseButtonDown(Drag)->Script Editor
Code: Select all
selected=connected;


And whenever you want to connect certain actors, set their connected to the same number.

Re: connecting actors

PostPosted: Thu Jun 18, 2009 5:35 am
by MrB
Really appreciated that you got back to me on this. I will have a play over the weekend and let you know how I am getting on.