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

Report as inappropriate.

danpost
danpost presents ...

2013/12/10

Horiz/Vert/Univ Scroller

A Scroll class that supports scrolling of the background of your world. It uses the size of the background image supplied to set the scrolling limits of your world. The methods used for performing the scrolling return any amounts of changes in the scrolling offsets so that actors can be scrolled to those amounts..

It is fairly well documented; at least, to the point where it should be clear as to how to implement the engine into another scenario.

Future update may include a method to scroll the actors as well; however, doing so may make things more complicated than I wanted.

4757 views / 32 in the last 7 days

7 votes | 0 in the last 7 days

Tags: demo with-source terrain scroll danpost

This scenario is a member of: Support Classes by danpost


open in greenfoot
Your browser does not support the canvas tag.
KartoffelbrotKartoffelbrot

2013/12/10

nice car
shrucis1shrucis1

2013/12/10

I think that the example of the car traversing 'rugged' terrain is more helpful to me than the scrolling world is, as I am (or was) trying to make a game where I needed that kind of car.
danpostdanpost

2013/12/10

@shrucis1, your welcome.
A new version of this scenario was uploaded on Thu Dec 12 15:18:36 UTC 2013 More documentation added
A new version of this scenario was uploaded on 2015-03-09 16:55:06 UTC Updated version! Scroll class supports scrolling of background image only. Size of image determines scroll limits.
A new version of this scenario was uploaded on 2020-10-29 17:40:29 UTC
MatrixWorldMatrixWorld

2023/7/22

Nice! It seems like their is a huge difference in fps while scrolling the world
danpostdanpost

2023/7/25

@MatrixWorld : Yes, slow while scrolling. That is because this scrolling engine scrolls the "universal" image, which, because of its size, means a lot of cpu activity. My Scroller class (found by way of my "Scrolling Tutorial" scenario, can be used to scroll only actors, which would pretty much solve that issue. Search "Scrolling Tutorial" to locate.
danpostdanpost

2023/7/25

@MatrixWorld : See my previous comment. Wanted to mention to read the description of the searched scenario for related scenarios and codes.
MatrixWorldMatrixWorld

2023/8/1

Well, its smoothy then the previous one

Want to leave a comment? You must first log in.

Who likes this?

MatrixWorld MrSkyPanda ☾hloe sandra421 herusaputra Kartoffelbrot FlyingRabidUnicornPig