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

Comments for Scrolling SuperWorld

Return to Scrolling SuperWorld

A new version of this scenario was uploaded on Wed Nov 21 10:54:22 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Improved background image scaling.
A new version of this scenario was uploaded on Wed Nov 21 12:13:38 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Restricted setting scrolling background when cell-size of world is greater than one.
A new version of this scenario was uploaded on Wed Nov 21 15:20:13 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Lifted previous restriction on scrolling background.
A new version of this scenario was uploaded on Wed Nov 21 15:20:53 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Lifted previous restriction on scrolling background.
MatheMagicianMatheMagician

2012/11/21

Very nice and straightforward!
A new version of this scenario was uploaded on Wed Nov 21 16:59:53 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Cleaned up documentation.
danpostdanpost

2012/11/21

@MatheMagician, thank you. Kudos to lgbrf and Game/maniac as well. The same for anyone else who decides to 'like' this.
A new version of this scenario was uploaded on Wed Nov 21 21:39:09 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Neede to add 'removeObject(s)' methods.
danpostdanpost

2012/11/21

I do believe this project is complete. If anyone encounters any problems of any kind, or has any concerns, please do not hesitate to leave a comment. Also, if you can think of any improvements or have any suggestions, I would like to know about them. On the brighter side, if you have any raves, or if you so feel moved to, again, please do not hesitate to post up.
A new version of this scenario was uploaded on Wed Nov 21 21:56:31 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Needed to add 'removeObject(s)' methods.
KiwiiKiwii

2012/11/22

Hi there! First of all, I think this is extremely helpful and easy to use. Thank you for the upload :) I've been trying to implement this into a platform game for college and it works perfectly until an object is removed from the game. In my case, a coin when the player collects it. I get the following error.. java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed. at greenfoot.Actor.failIfNotInWorld(Actor.java:663) at greenfoot.Actor.getX(Actor.java:157) at sWorld.scrollObjects(sWorld.java:202) at sWorld.act(sWorld.java:163) at greenfoot.core.Simulation.actWorld(Simulation.java:571) at greenfoot.core.Simulation.runOneLoop(Simulation.java:506) at greenfoot.core.Simulation.runContent(Simulation.java:213) at greenfoot.core.Simulation.run(Simulation.java:203) I think i have it pinned to the array in the world class, and its still trying to place the object once removed. What would you recommend to fix this?
danpostdanpost

2012/11/22

@kiwii, re-download the source and replace the code for the SWorld class back into your scenario. I had inadvertently forget to add the overrides on 'removeObject'. They were finally added in my last update. Thanks. @To All Who Have Downloaded This Prior To Last Update, please re-download source to correct problem with 'removeObject' situations.
KiwiiKiwii

2012/11/22

Thank you ^_^! Works perfectly, your scenario is extremely useful
danpostdanpost

2012/11/24

Just a reminder, if anyone has download this before the last update -- Please, re-download to correct a bug.
danpostdanpost

2012/11/26

Last reminder, if anyone has downloaded this before the last update -- Please, re-download it to correct a snafu. (that is, if you do not have 'removeObject' methods in the SWorld class).
A new version of this scenario was uploaded on Mon Nov 26 18:30:25 UTC 2012 An easy to use super-class for a scrolling world; fully documented. Found and fixed a bug.
A new version of this scenario was uploaded on Sat Dec 01 19:44:11 UTC 2012 A super-class for a scrolling world; fully documented and very easy to use. Normalized the code.
epicm512epicm512

2012/12/2

why does the wombat thing turn red
danpostdanpost

2012/12/2

@epicm512, I have no clue as to what you are concerned with. As far as I know, nothing is turning red.
epicm512epicm512

2012/12/2

the wombat slightly turns red after a little bit
danpostdanpost

2012/12/2

I believe that may be a bit of an optical illusion due the the background not being a consistant color/brightness or maybe, but less likely, the movement of the wombat causes a slight change in its color (or maybe a combination of both). I assure you, however, that the wombat is not changing colors at all.
Game/maniacGame/maniac

2012/12/2

its probably just the background colour messing with your head
Game/maniacGame/maniac

2012/12/2

a bit like an optical illusion does
epicm512epicm512

2012/12/2

ok but it is kinda odd
Game/maniacGame/maniac

2012/12/2

Just noticed danpost said the same thing 3 minutes before me
MatheMagicianMatheMagician

2012/12/17

@danpost and game/maniac, I also noticed the slight tinting red when the wombat turned and remembered a discussion about it here: http://www.greenfoot.org/topics/find/3143#post_3143.
A new version of this scenario was uploaded on Sat Dec 29 21:16:15 UTC 2012 A super-class for a scrolling scenario. Now works with cells greater than pixel-sized (dims rounded up to next odds).
comandodude101comandodude101

2012/12/31

were can I find the scroll code?
Game/maniacGame/maniac

2012/12/31

@MatheMagician now I understand so it is just a bug in JDK 7 for windows xp, nothing to do with optical illusion, that's probably why I didn't notice the tint.
TheStopTheStop

2013/1/7

How do you get the window to follow the character as it moves about?
danpostdanpost

2013/1/7

@TheStop, please open the scenario in Greenfoot and look at the methods the 'act' method calls in the 'SWorld' world class.
DytanothDytanoth

2013/1/11

When I copy the Actors to my project, and add the SWorld & MyWorld Code it won't work, but when I copy the MyWorld from this Scenario to My Scenario it does work.. why won't it work ? super(50, 45, 16,50,60); setMainActor(new Wombat(), 23, 23); mainActor.setLocation(23, 23); GreenfootImage bg = new GreenfootImage("watertexture.jpg"); setScrollingBackground(bg); My world scrolls vertically. But the code above doesn't work in my world, but in the other world it does.. :/
danpostdanpost

2013/1/11

@Dytanoth, maybe I will add another method called 'fillScrollingBackground(GreenfootImage image, int wide, int high) and have it create the full-sized background image required from the 'smaller' image (to allow a 60x60, or whatever size, image to repeat and fill the background of the whole scrolling area).