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

Report as inappropriate.

danpost
danpost presents ...

2012/11/20

Scrolling SuperWorld

An easy-to-use world superclass that implements scrolling actors and background. Fully documented with instruction and code.
When using cell sizes greater than one, all dimensions (world and universal) are rounded up to next odd integer.

jump: up arrow
move: left and right arrows

26102 views / 4050 in the last 7 days

38 votes | 3 in the last 7 days

Tags: demo with-source scroll danpost superclass supportclass superworld

This scenario is a member of: Scrolling games, Support Classes by danpost


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

2020/11/29

I think it will show it in terminal which i don't want System.out.println(""+((char)8595)+""); I want arrow to be shown in the world getBackground().drawImage(new GreenfootImage(""+((char)8595)+"",20,null,null)500,500); Will it work ⬆⬆⬆
Roshan123Roshan123

2020/11/29

I copied the arrow frm blue j terminal and wanted to paste it in greenfoot to show it in world
danpostdanpost

2020/11/29

@Roshan, it will work: getBackground().drawImage(new GreenfootImage(""+((char)8595), 20, Color.BLACK, new Color(0, 0, 0, 0)), 500, 500);
SwaggyXiaoSwaggyXiao

2021/1/25

Hi, I am just interested in how did u make the background moving?
danpostdanpost

2021/1/25

@SwaggyXiao, please refer to my Scrolling Tutorial scenario on image scrolling (see main text and link at bottom on "Actor follow scrolling code"). The scenario is located at: https://www.greenfoot.org/scenarios/18226
SwaggyXiaoSwaggyXiao

2021/1/28

THANK YOU!
AnJoMortoAnJoMorto

2021/2/16

Good Morning, is there a way to add moving enemies when using an ImageScrollWorld like this one. I can't figure a code that lets the enemies move around and at the same time keep them in synch with the rest of the game moving with the player movements. Thank you for your time
danpostdanpost

2021/2/16

@AnJoMorto, are you not creating them with a true boolean? addObject(new Enemy(), x, y, true);
AnJoMortoAnJoMorto

2021/2/17

@danpost oh yes I see. I only had the base code of the ImageScrollWorld from your scrolling tutorial (https://www.greenfoot.org/scenarios/18226). I just added the methods to add a scrollable object, and it works now. Thank you very much!
MatrixWorldMatrixWorld

2023/8/1

I mean this one is smooth than the previous one

See all comments

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

Who likes this?

Ohnodamon xuperL Super_Hippo JoeyStaggs Sonal julius68 Kevroa AreebRaza MusicalScore Jellyfish etbillder getreides Ruvero Dillybar Heavenly_Father_Banting Mimagic awesomeinmyworld Homicdle_moth asterodia al_griff