Page 1 of 1
Follow the Player
Posted:
Tue Sep 04, 2007 3:24 am
by Kuraudo-sama
How do I make it so that when I walk it will be like a camera following me.
Re: Follow the Player
Posted:
Tue Sep 04, 2007 6:48 am
by d-soldier
The easiest way would to PARENT the view to the player.
Re: Follow the Player
Posted:
Tue Sep 04, 2007 5:04 pm
by Kuraudo-sama
The only problem I have with this is when I jump the screen follows that too.
Re: Follow the Player
Posted:
Tue Sep 04, 2007 8:12 pm
by jman
make a keydown event, change parent to none and make a collision event for your player against the ground so it changes back
Re: Follow the Player
Posted:
Wed Sep 05, 2007 12:51 am
by Game A Gogo
easiest way around this would be in the view's draw actor
- Code: Select all
x=player.x+(view.width/2);
Re: Follow the Player
Posted:
Wed Sep 05, 2007 1:27 am
by Kuraudo-sama
jman wrote:make a keydown event, change parent to none and make a collision event for your player against the ground so it changes back
Thats all fine and great but you can just jump off screen doing that.
Game A Gogo wrote:easiest way around this would be in the view's draw actor
- Code: Select all
x=player.x+(view.width/2);
This doesn't work.
Re: Follow the Player
Posted:
Wed Sep 05, 2007 1:45 am
by Game A Gogo
what does it do?
Re: Follow the Player
Posted:
Wed Sep 05, 2007 1:58 am
by Kuraudo-sama
It makes the screen behave strange, and it scrolls improperly. Like fast on the right, and slow on the left.
Re: Follow the Player
Posted:
Thu Sep 06, 2007 12:33 am
by Game A Gogo
odd...
Re: Follow the Player
Posted:
Sat Sep 08, 2007 5:38 am
by Kuraudo-sama
...uh. Is any one gonna help me?
Re: Follow the Player
Posted:
Sat Sep 08, 2007 12:15 pm
by pixelpoop
very easy way is to put this in the draw actor event of the view actor:
x=player_actor.x-160;
//you will need to change the name of the actor and the number
//the number should be half of your view's width. Mine is 160 because my view's width is 320.
For a smoother view follow action:
Go into GE's help menu, under getting started, open "making the view follow the actor 2". It will walk you through the steps.
Re: Follow the Player
Posted:
Tue Sep 11, 2007 11:33 pm
by J Maker
here ths is for smooler scroller view:
- Code: Select all
double weight = 10;
x = ((weight - 1)*x + (player.x - width/2))/weight;
y = ((weight - 1)*x + (player.y - hight/2))/weight;