Define scrolling backgrounds. Tiled or just plain images?
I need some help with making scrolling backgrounds. CAn someone point me to a tut or give me some advice. thx.
http://one.revver.com/watch/170516
http://one.revver.com/watch/167200
Please click the links above to watch my stick figure animations,
and please, if you have the time, click the ads at the end to earn me some money.
Define scrolling backgrounds. Tiled or just plain images?
just plain png's
http://one.revver.com/watch/170516
http://one.revver.com/watch/167200
Please click the links above to watch my stick figure animations,
and please, if you have the time, click the ads at the end to earn me some money.
when you run to the edge of the screen i need the screen to scroll so you can continue moving in that direction.
http://one.revver.com/watch/170516
http://one.revver.com/watch/167200
Please click the links above to watch my stick figure animations,
and please, if you have the time, click the ads at the end to earn me some money.
Do you want to continous scrolling (ie, player is 'still' on the screen the background scrolls) or staggered (ie, player hits the right edge of the screen, player is placed to the left and a new image is blitted to the background).
I wanted it like Sora's adventure backgrounds. Where, when you get to a specific X coordinate on the screen the background scrolls, and when you get to the edge of the last picture, it stops scrolling
http://one.revver.com/watch/170516
http://one.revver.com/watch/167200
Please click the links above to watch my stick figure animations,
and please, if you have the time, click the ads at the end to earn me some money.
The easiest way I found to do things like this is to set everything in World co-ordinates and have a camera object.
As every object's position is defined to the top left of the images, the camera's relative position to the screen will always be in the top left.
When you draw the screen, you draw everything that would be on screen relative to the camera based on their world co-ordinates.
So when you move your character, it is a certain distance from/to the camera, you move the camera to keep the player on screen.
I did this for my RTS Prototype that was 'released' a month or two back.
This is just one way to achieve the effect. The other is to have every object's position relative to the screen which I find harder to keep track of in my head and code.
so, how would i go about making this "camera" object?
http://one.revver.com/watch/170516
http://one.revver.com/watch/167200
Please click the links above to watch my stick figure animations,
and please, if you have the time, click the ads at the end to earn me some money.
All it is a x and y position.
eg.
camera x = 20
camera y = 30
sprite x = 40
sprite y = 50
to find out where to draw the sprite on the screen it is simply sprite - camera.
Therefore:
sprite on screen position x = 40 - 20 = 20
sprite on screen position y = 50 - 30 = 20
oh, ic i wil try this later tonight
http://one.revver.com/watch/170516
http://one.revver.com/watch/167200
Please click the links above to watch my stick figure animations,
and please, if you have the time, click the ads at the end to earn me some money.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks