It must be 900 for wide and 540 for High if i remember right
Let's try a different way. What are the dimensions of your "Unknown.jpeg" image?
251x200
Really ??? No wonder it won't scroll !!! In your Sky constructor, adjust to the following:
int bgWide = 1200;
int bgHigh = 540;
I did it but it didn't change anything
public class Sky extends World
{
int bgWide = 1200;
int bgHigh = 540;
public static final int WIDE = 930;
public static final int HIGH =540;
public static final int CELL =1;
Scroller scroller;
Actor Megaman;
public Sky()
{
super( WIDE, HIGH, CELL, false);
GreenfootImage bg = new GreenfootImage("Unknown.jpeg");
int bgWide = bg.getWidth();
int bgHigh = bg.getHeight();
scroller = new Scroller(this, bg, bgWide, bgHigh);
Megaman = new Megaman();
addObject(Megaman, bgWide/2, bgHigh/2);
scroll();
Spawn();
}
public void act()
{
if (Megaman != null && Megaman.getWorld() == this) scroll();
}
private void scroll()
{
int dsx = Megaman.getX()-WIDE/2;
int dsy = Megaman.getY()-HIGH/2;
scroller.scroll(dsx, dsy);
}
That's my code if it helps u spot the problem