@tkiesel, you suggested this:
// find a similar positive value for scroll positions
if (imageX < 0) { imageX %= wide; imageX += wide; }
if (imageY < 0) { imageY %= high; imageY += high; }
// get new starting positions for drawing 'scrollImage'
imageX = imageX%wide;
imageY = imageY%high;
which does indeed work (I, for some reason, was under the impression that all mod returns were positive -- apparently, on negative values, when there is a remainder, the value returned is negative; hence, the confusion).
Even better, then, would be this:
// find a similar near-zero value for scroll positions
imageX = imageX%wide;
imageY = imageY%high;
// adjust for negative values
if (imageX < 0) imageX += wide
if (imageY < 0) imageY += high;
@Nosson, start a discussion thread on this. Be more detailed in your description. Also, if you could describe the platform scenario of which you mentioned (I do not believe that anything is "missing").
@tkiesel, by 'freeware', I mean the code is not under any license of any kind and is free to use at will. I have found one bug in the class which I will need to address (hopefully today). It is in the unlimited, no-background image scrolling part of the scroll method where the scrolling offsets fail to be updated.
@tkiesel, as far as adding the line (again), I was incorrect when I said "calling scroll from the world constructor is useful in crating the initial background image sometimes". This is actually being done by both the Scroller class constructors -- calling scroll with both parameter values of zero (see lines 46 and 77). So, not "sometimes"; but, "all the time". Adding your line would prevent these calls from doing their functions (setting the initial background image of the world).
@tkiesel, I think the calling statement should check that condition for scrolling. Calling scroll from the world constructor is useful in creating the initial background image sometimes and adding your line there would conflict with that.
2017/3/30
Scrolling Tutorial
2017/3/29
Scrolling Tutorial
2017/3/29
Scrolling Tutorial
2017/3/29
Scrolling Tutorial
2017/3/2
The Impossible Challenge
2017/2/21
Scrolling Tutorial
2017/2/21
Scrolling Tutorial
2017/2/20
Scrolling Tutorial
2017/2/20
Scrolling Tutorial