06-13-2008, 06:13 AM
(This post was last modified: 11-04-2008, 02:51 PM by Silverthorn.)
update:
[youtube]WMMehUnrX9w[/youtube]
scrolling bg implemented. however, my algorithm is different from lf2's algorithm. I don't even know how mine works =S. In english, I used
ratio = width ÷ map_width
renderx = x + (ratio × cam.x)
x - defined in bg.dat (layer)
width - defined in bg.dat (layer)
map_width - width of the whole bg
renderx - coordinate to render the image
cam.x - the x coordinate of the game's "camera" relative to the map.
plus all those optimization stuff I mentioned earlier (and I also optimized the bg layer images)
Azriel~
[youtube]WMMehUnrX9w[/youtube]
scrolling bg implemented. however, my algorithm is different from lf2's algorithm. I don't even know how mine works =S. In english, I used
ratio = width ÷ map_width
renderx = x + (ratio × cam.x)
x - defined in bg.dat (layer)
width - defined in bg.dat (layer)
map_width - width of the whole bg
renderx - coordinate to render the image
cam.x - the x coordinate of the game's "camera" relative to the map.
plus all those optimization stuff I mentioned earlier (and I also optimized the bg layer images)
Azriel~

Chat
![[Image: ZucdcMY.png]](https://i.imgur.com/ZucdcMY.png)