Problems with the view

Non-platform specific questions.

Problems with the view

Postby metaknight22 » Sat Jan 24, 2009 8:41 am

I want to make the view follow the main character on the x axis and the background on the y axis.
This is the code I'm using.
Code: Select all
x = KirbyStarship.x-width/2;
y = background.y-height;

This follows the main character and the background but it is cutting out half the background.
Any ideas???
Projects
Kirby Starship Game

I'm a newbie so I haven't done much.
User avatar
metaknight22
 
Posts: 25
Joined: Fri Jan 23, 2009 7:34 am
Score: 1 Give a positive score

Re: Problems with the view

Postby skydereign » Sat Jan 24, 2009 9:50 am

I believe that you need to change it to,
Code: Select all
x = KirbyStarship.x-width/2;
y = background.y-height/2;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Problems with the view

Postby metaknight22 » Sat Jan 24, 2009 11:16 am

Nah I already tried that. It puts the middle of the background in the bottom of the screen.
Projects
Kirby Starship Game

I'm a newbie so I haven't done much.
User avatar
metaknight22
 
Posts: 25
Joined: Fri Jan 23, 2009 7:34 am
Score: 1 Give a positive score

Re: Problems with the view

Postby skydereign » Sat Jan 24, 2009 11:30 am

How do you mean, you want the view to follow the background? Can you post your game on, or at least that bit? It seems to work with me. The only mess up I can find is if you position your background wrong, because of the actual reference to the actors x or y. So if it is placed right I think it will work.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Problems with the view

Postby metaknight22 » Sun Jan 25, 2009 1:40 am

I want the bottom of the actor named Ground to be at the bottom of the screen without any of it being cut off.
Thanks for your help. :D
Attachments
KirbyStarshipGame.zip
(1.71 KiB) Downloaded 107 times
Projects
Kirby Starship Game

I'm a newbie so I haven't done much.
User avatar
metaknight22
 
Posts: 25
Joined: Fri Jan 23, 2009 7:34 am
Score: 1 Give a positive score

Re: Problems with the view

Postby jimmynewguy » Sun Jan 25, 2009 2:11 am

srry but you have to post the Data folder with the GED not just the GED :D
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Problems with the view

Postby skydereign » Sun Jan 25, 2009 3:32 am

I am shooting in the dark here, as your ged file does not have the data, but I believe this is what you want.
Code: Select all
y=Ground.y+Ground.height/2-height;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Problems with the view

Postby metaknight22 » Sun Jan 25, 2009 5:23 am

It worked!!! :D
Thanks for all your help.
Projects
Kirby Starship Game

I'm a newbie so I haven't done much.
User avatar
metaknight22
 
Posts: 25
Joined: Fri Jan 23, 2009 7:34 am
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron