Viewing

Non-platform specific questions.

Viewing

Postby arcreamer » Wed Aug 01, 2007 5:44 am

hey guys im a little stuck here... see, im making a game and i want to have it so when im going my view is following me but i dont want to have to make the view parent my player... i also want so that when i move really far to the right/left i dont want the view to show the screen color of GE... isnt their like a region or something do to that? can someone help me out here?
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Postby d-soldier » Wed Aug 01, 2007 6:16 am

Heres a demo of a smooth moving view rig. Keep in mind, I'm not the genius who thought this up... I thought there was a demo already, but couldn't find it. Keep in mind, this works through various objects draw actors scripts, NO parenting involved.
Attachments
viewmove.zip
(59.75 KiB) Downloaded 112 times
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby DocRabbit » Wed Aug 01, 2007 6:53 am

Basically, you just put the wire frame region on edges of your view and make the view their parent(so they move with the view). The just do a collision check, non repeating, and move the view in reference to the view a variable distance. A good starting zone for the distance is the distance between opposing regions, (left trigger, right trigger). The subtract 2*width of your player. What you are trying to do is avoid the ping-pong effect. If you get it the first time, you'll quickly see why it is called the ping-pong effect. That is the very basic method not parenting the player to the view. You could disable the player moving while the view is in its moving stage by just running your move the player routine against view's velocity being anything but 0.(zero) depending on how close in these zones are to the center of the screen, you can have the screen stay fairly centered or the other extreme would be the Zelda scroll.
User avatar
DocRabbit
 
Posts: 114
Joined: Fri Oct 27, 2006 2:56 am
Score: 10 Give a positive score

Postby arcreamer » Wed Aug 01, 2007 7:53 pm

thank ya. ill try that
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron