Change to another actor

Game Editor comments and discussion.

Change to another actor

Postby ThaKid244 » Tue Feb 01, 2011 8:46 pm

Hi. I have two main charcters, raphael and michael. The view usually sits on michael but i want it to where when i press the "2" key, it switches parent to raphael and centers the view on him. Can anyone help? thx
K Thanks! ;)
User avatar
ThaKid244
 
Posts: 34
Joined: Thu Dec 23, 2010 6:40 pm
Score: 0 Give a positive score

Re: Change to another actor

Postby lcl » Tue Feb 01, 2011 9:11 pm

Do it like this:
Key down - 2 - script editor:
Code: Select all
ChangeParent(...);
view.x = raphael.x - (view.width / 2);
view.y = raphael.y - (view.height / 2);

:D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Change to another actor

Postby ThaKid244 » Tue Feb 01, 2011 9:53 pm

Could you explain what that does so i dont just copy and paste and dont know whats going on? thx
K Thanks! ;)
User avatar
ThaKid244
 
Posts: 34
Joined: Thu Dec 23, 2010 6:40 pm
Score: 0 Give a positive score

Re: Change to another actor

Postby schnellboot » Tue Feb 01, 2011 10:02 pm

Code: Select all
ChangeParent(...); //change parent
view.x = raphael.x - (view.width / 2); //move view to raphael and center
view.y = raphael.y - (view.height / 2); //same as x ..

This is lcl's code commented.
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Change to another actor

Postby ThaKid244 » Tue Feb 01, 2011 10:08 pm

Okay thank you once again
K Thanks! ;)
User avatar
ThaKid244
 
Posts: 34
Joined: Thu Dec 23, 2010 6:40 pm
Score: 0 Give a positive score

Re: Change to another actor

Postby schnellboot » Tue Feb 01, 2011 10:13 pm

again?
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Change to another actor

Postby ThaKid244 » Tue Feb 01, 2011 10:16 pm

haha yes im saying thank you again
K Thanks! ;)
User avatar
ThaKid244
 
Posts: 34
Joined: Thu Dec 23, 2010 6:40 pm
Score: 0 Give a positive score

Re: Change to another actor

Postby again » Wed Feb 02, 2011 2:46 am

Thank you for thanking me.
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

Re: Change to another actor

Postby schnellboot » Wed Feb 02, 2011 5:12 am

lol ..
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron