Page 1 of 1
sprite scrolling
Posted: Wed May 27, 2009 7:50 pm
by Tomdev
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?
Re: sprite scrolling
Posted: Wed May 27, 2009 11:38 pm
by WinterMute
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.
Re: sprite scrolling
Posted: Thu May 28, 2009 3:20 pm
by Tomdev
thanks, I can go further with my game

too easy actually