I am a very beginner in game development. All I want to achieve in the beginning is a free scrollable background like in a strategy game with my custom graphics. In my case it is supposed to be a 2d city map where the user can select buildings. How can I achieve that as easy as possible in android? With OpenGL? Die you have any examples especially for this scrolling functionality?
If you want the buildings in the backgroudn to be clickable you could create different classes for each building, assign an image to the object and use ArrayLists to determine how many you would like in the background.
You would have to run a thread in your main class to move the buildings either right or left, check the locations and if
x - image.getWidth < 0 then the whole building has left the screen, this means another building needs to be added to the right.
I had a similar problem when I wanted to create a scrolling background. I found the following tutorial (in Java) which is quite easy and worked: