|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Scrolling the camera with a side-scrolling video game |
|
![]() darkawakenings Member since: 2/12/2003 From: Westminster, USA |
||||
|
|
||||
| Right now I am scrolling the camera so that the character always stays perfectly in the center, (horizontally). It looks rather unreal, and I was wondering how I should go about making this look more realistic. I seem to remember the camera rather sliding around in the old Mario type games, but i can't seem to emulate that effect very well, and I don't know how I would go about doing it. Math maybe? ;) |
||||
|
||||
![]() gr0undz3r0 Member since: 7/15/2004 From: Guelph, Canada |
||||
|
|
||||
| My suggestion would be to only scroll the camera when the character gets a pre-determined distance to the sides of the screen then scroll the camera with the character. So you have your character, he starts running to the right say he's 100 pixels from the right side of the screen, start scrolling the camera. He does a quick turn around and runs at the left side of the screen, wait until the character is 100 pixels(or whatever you chose) from the left side of the screen and start scrolling it that way. That gives the character time to react to any enemies that may appear. |
||||
|
||||
![]() jflanglois Member since: 5/13/2004 From: Washington, DC, United States |
||||
|
|
||||
| Or you could make the camera speed vary based on the position of the character from the center of the screen. So if he's 1 logical unit away from the center, the camera goes slowly, but if he's 10 away, it goes fast. You might do something like if he's 3/8ths from the right of the screen, make the camera as fast as the character. [edit] To give the player visibility, you might change that based on which direction the character is facing. So if he is facing right, the "center" of the screen is 1/4th from the left. I hope I'm not being too incomprehensible... HTH Regards, jflanglois |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|