connecting actors

Talk about making games.

connecting actors

Postby MrB » Wed Jun 17, 2009 9:53 pm

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?
MrB
 
Posts: 41
Joined: Sun Jun 14, 2009 8:41 am
Score: 0 Give a positive score

Re: connecting actors

Postby skydereign » Wed Jun 17, 2009 10:25 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: connecting actors

Postby MrB » Thu Jun 18, 2009 5:35 am

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.
MrB
 
Posts: 41
Joined: Sun Jun 14, 2009 8:41 am
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest