how to have view follow actor

Non-platform specific questions.

how to have view follow actor

Postby frodo » Tue May 23, 2006 6:54 pm

I have an actor controlled by the arrow keys. how can I make the view follow my actor only horizontaly, not verticly?
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby makslane » Tue May 23, 2006 7:32 pm

You can try this:

In the 'Draw Actor' event of view, put this script:

x = player.x - width/2;

To put some elasticity:

x = ((player.x - width/2) + 9*x)/10;
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby frodo » Tue May 23, 2006 8:56 pm

Thanks, Makslane. I liked your elasticity thing!
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby Troodon » Wed May 24, 2006 6:27 am

x = ((player.x - width/2) + 9*x)/10;



Me too, I've allways loved those tricks!
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby DilloDude » Wed May 24, 2006 8:03 am

Be careful about moving the view all the time though; it can cause a decrease in performance.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest