sprite scrolling

Post Reply
Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

sprite scrolling

Post by Tomdev » Wed May 27, 2009 7:50 pm

ok, so I was coding on my game and i came across this problem: when i position a sprite on x = 300 for example i can't view it at the beginning. how can i scroll the sprite system? i mean that sprites placed on x = 0 wille disappear at a specific moment and the sprite at x = 300 will be visible?

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: sprite scrolling

Post by WinterMute » Wed May 27, 2009 11:38 pm

Keep a track of the top left coordinates of your playfield and subtract these from the sprite coordinates you intend to display. Obviously if the new coordinates determine that the sprite will be completely invisible then don't add it to your display list.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: sprite scrolling

Post by Tomdev » Thu May 28, 2009 3:20 pm

thanks, I can go further with my game :P too easy actually

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests