Follow the Player

Talk about making games.

Follow the Player

Postby Kuraudo-sama » Tue Sep 04, 2007 3:24 am

How do I make it so that when I walk it will be like a camera following me.
Kuraudo-sama
 
Posts: 12
Joined: Wed Jul 25, 2007 4:42 am
Score: 1 Give a positive score

Re: Follow the Player

Postby d-soldier » Tue Sep 04, 2007 6:48 am

The easiest way would to PARENT the view to the player.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Re: Follow the Player

Postby Kuraudo-sama » Tue Sep 04, 2007 5:04 pm

The only problem I have with this is when I jump the screen follows that too.
Kuraudo-sama
 
Posts: 12
Joined: Wed Jul 25, 2007 4:42 am
Score: 1 Give a positive score

Re: Follow the Player

Postby jman » Tue Sep 04, 2007 8:12 pm

make a keydown event, change parent to none and make a collision event for your player against the ground so it changes back :)
Labyrinth-just starting
User avatar
jman
 
Posts: 123
Joined: Fri Jul 20, 2007 7:07 pm
Location: Ontario, Canada
Score: 2 Give a positive score

Re: Follow the Player

Postby Game A Gogo » Wed Sep 05, 2007 12:51 am

easiest way around this would be in the view's draw actor
Code: Select all
x=player.x+(view.width/2);
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Follow the Player

Postby Kuraudo-sama » Wed Sep 05, 2007 1:27 am

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.
Kuraudo-sama
 
Posts: 12
Joined: Wed Jul 25, 2007 4:42 am
Score: 1 Give a positive score

Re: Follow the Player

Postby Game A Gogo » Wed Sep 05, 2007 1:45 am

what does it do?
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Follow the Player

Postby Kuraudo-sama » Wed Sep 05, 2007 1:58 am

It makes the screen behave strange, and it scrolls improperly. Like fast on the right, and slow on the left.
Kuraudo-sama
 
Posts: 12
Joined: Wed Jul 25, 2007 4:42 am
Score: 1 Give a positive score

Re: Follow the Player

Postby Game A Gogo » Thu Sep 06, 2007 12:33 am

odd...
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Follow the Player

Postby Kuraudo-sama » Sat Sep 08, 2007 5:38 am

...uh. Is any one gonna help me?
Kuraudo-sama
 
Posts: 12
Joined: Wed Jul 25, 2007 4:42 am
Score: 1 Give a positive score

Re: Follow the Player

Postby pixelpoop » Sat Sep 08, 2007 12:15 pm

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.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Re: Follow the Player

Postby J Maker » Tue Sep 11, 2007 11:33 pm

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;
Some people believe Chuck Norris evolved from a dinosaur, the Chucknorisaurus.
----------------------------------------------------------------------------------
Chuck Norris doesn't sleep, he waits.
----------------------------------------------------------------------------------
Chuck Norris doesn't hunt, he kills.
----------------------------------------------------------------------------------
Chuck Norris once shot down a german fighter plane with his finger by yelling BANG!!!
----------------------------------------------------------------------------------
User avatar
J Maker
 
Posts: 177
Joined: Fri Jun 22, 2007 4:17 pm
Location: in the stick version of Hyrule
Score: 10 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron