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

2018/2/16

Moving Screen

Maus2525 Maus2525

2018/2/16

#
I have seen a few tutorials about a moving screen, but I couldn't find what I needed. The purpose of my game is to create a map, whose dimensions within the game are 3000 x 3000 (which is obviously greater than the size of a Greenfoot screen - approximately 1600 x 900). Once the actor moves through the scene, the background should move in the direction of the character (without making the infinite scrolling world). Could you help me find a solution?
danpost danpost

2018/2/16

#
Even 1600x900 is larger than most screens. I usually limit my world view port to 1000x600, which may still be too large for some folks (my standard is 800x600). Also, the larger it is, the more lag your scenario will exhibit. The term you are looking for, as far as a moving screen, is "scrolling". I have a re-usable support class for scrolling which is well documented. A demo has the URL of a tutorial in its description which, in turn, has the URL of a discussion post with the Scroller class code in its description.
Maus2525 Maus2525

2018/2/17

#
Thank you for the answer!!!
You need to login to post a reply.