This site requires JavaScript, please enable it in your browser!
Greenfoot back
Dillybar
Dillybar wrote ...

2015/1/4

Relative movement issue with scrolling world

1
2
danpost danpost

2015/1/4

#
That is correct. But you do not need the overall X scrolled to add an actor into the world. Actors have really nothing to do with the overall scrolling offsets or coordinates. I created the scrolling engine in such a way that will allow you to program pretty much everything as you normally would if you were not using the class. If you want to add an object at the actor's current location, those are the coordinates to use. Once you set the main actor and the scrolling background image, the only thing different would be using the alternate 'addObject' method for your stats and controls (like the jump counter in the demo scenario). Someone previously had an issue with added things outside the view window and I incorporated the 'getUnivX' and 'getUnivY' methods to assist in that respect (I cannot remember the exact circumstances and really cannot see the need for those methods -- at least, not at this time; I will have to research that).
danpost danpost

2015/1/4

#
One discussion on the 'getUnivX' and 'getUnivY' methods is here. It appears that is when I added the 'getScrollingWidth' and 'getScrollingHeight' methods. Anyways it does provide a use for the methods (as they were written at the beginning before this post; or, as in this discussion) and shows how they can be used.
You need to login to post a reply.
1
2