(Intro: So, I was making an '2D RPG' style project, and made a 4000x4000 base Map, with a viewpoint of 1280x720, and I wanted to make my Actor Centered and then make the Background Scroll accordingly to the Actor's movement.)
Just like in this guide: DansPost Tutorial
It has a Scroller Class and multiple instances of different Scroller types.
The one I wanted to implement in my "Main" World was the ImageScroll (which meets all the requisites) to what I wanted in the first place.
So I wrote the following code provided in the Tutorial for the ImageScroll.
The Question is:
In the Tutorial he provides two different "private void scroll()" methods:
The first one that does:
The Second one that does:
Which gives me an Error, "method scroll() is already defined in (this) class"
The first question I had was: I am defining the "ImageScrollWorld" under World to then create a Subclass which creates an instance of this type of World ("ImageScrollWorld"), is that how it is meant to be done?
The second question was: I assume the second definition of "method scroll()" is probably meant to be written as maybe Override somewhere else??
If yes, where should I call it?? Under my World instance of "ImageScrollWorld", in a instance of "Player" under Actor?
------------------------------------------
(I've only had a few weeks of experience under Greenfoot, maybe the questions are obvious, but I don't wanna move or Delete any further code without a "public opinion").
First:
// attempts scrolling when actor is not in center of visible world
private void scroll(){
(...)
}
Second:
// the following can be used to allow some actor movement before scrolling begins:
// attempts scrolling when actor is outside roaming limits
private void scroll(){
(...)
}
