view move to plyer

Talk about making games.

view move to plyer

Postby elite » Wed Oct 10, 2007 12:37 am

Ok, another post by me :lol: This one is probably the most frustrating problems i have had. Im making a game called GYRMS. Everyone is throwing around grenades, molotov coctails, bombs, bullets, blah blah. Amazing i can do that but i still can figure out the game menu. There is a begin button and when i click it, i want the view to center on the mAJOR gYRM(PLAYER) but unfortunately, it doesnt and whenever the game starts, the view starts dropping down. A pretty confusing problem eh? :evil: :evil: :evil: :evil: :evil: :evil:
Thanks
Twigser :mrgreen:
after reading this you have just realized you have wasted 5 seconds of your life.
User avatar
elite
 
Posts: 29
Joined: Wed Oct 03, 2007 12:07 pm
Location: in URECTUM
Score: 0 Give a positive score

Re: view move to plyer

Postby pixelpoop » Wed Oct 10, 2007 2:21 am

Unlike regular actors the view's "center" is actually the top left corner.
If you code:
view.x=player1.x; view.y=player1.y;
this makes the center of actor player1 goto the top left corner of the view. To adjust for this you need to add half of your screen size to the view position for both x and y.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Re: view move to plyer

Postby Kalladdolf » Sat Nov 17, 2007 11:01 am

there are many good turtorials about that
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron