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

2016/11/25

Earthquakes

1
2
Nosson1459 Nosson1459

2016/11/25

#
In this scenario (http://www.greenfoot.org/scenarios/18183), by side-scrolling there is sometimes cracks in the bricks, it doesn't always happen, and when it does happen the cracks are not always in the same spot. What can I do to move the bricks for side-scrolling, but not spontaneously get these earthquake cracks (meaning, not all the bricks on the screen moved the same amount at the same time)?
danpost danpost

2016/11/25

#
That is probably because of the way you programmed the scrolling. Post all codes related to the scrolling. Indicate where each part is located (class and super; plus, method and where called from, if applicable).
Nosson1459 Nosson1459

2016/11/27

#
This is the world (with the "move" boolean for moving (side-scrolling)):
 import greenfoot.*; 
import java.util.List;
/**
 * This is the whole scene. It creates and contains the objects that are in it.
 */
public class Scene extends World
{
    public int lives=2;
    private int width=750;
    private int height=500;
    public int score=0;
    public int coins=0;
    public int level=2;
    private int a=1;
    public int moveSpeed=-7;
    public int addObjects;
    private int addObjectsAt=375;
    public boolean move=false;
    public boolean direction=true;
    public boolean onCloud=false;
    public boolean way=true;
    public boolean shooting=false;
    public boolean pause=false;
    public boolean isDoor=false;
    public boolean startToMove=false;
    public boolean isThere=false;
    public Scene()
    {  
        super(750,650,1,false);
        setPaintOrder(EndScore.class,GameOver.class,Win.class,HelpBox.class,Help.class,Coins.class,Level.class,Life.class,Score.class,Pause.class,Bar.class,Door.class,
        Pengu.class,DoorPost.class,Paused.class,Box.class,Shooting.class,Snake.class,SnakeD.class,Platform.class);
        addObject(new Bar(),375,18);
        addObject(new Coins("Coins: "),645,18);
        addObject(new Life("Lives: "),85,18);
        addObject(new Score("Score: "),470,18);
        addObject(new Level("Level: "),270,18);
        addObject(new HelpBox(),730,18);
        addObject(new Pause(),18,18);
        levelUp();
    }
    public void act()
    {
        if(!pause)
        {
            if(lives<0)
            {
                addObject(new GameOver(),375,325);
                addObject(new EndScore(),375,285);
                Greenfoot.stop();
            }
            if(coins==100)
            {
                score+=500;
                lives++;
                coins=0;
            }
            levelAct();
        }
    }
    public void reset()
    {
        List<Platform> platform=getObjects(Platform.class);
        List<Boxes> box=getObjects(Boxes.class);
        List<Pengu> pengu=getObjects(Pengu.class);
        List<Cliff> cliff=getObjects(Cliff.class);
        List<Monster> monster=getObjects(Monster.class);
        List<Coin> coin=getObjects(Coin.class);
        List<Bullet> bullet=getObjects(Bullet.class);
        removeObjects(platform);
        removeObjects(bullet);
        removeObjects(box);
        removeObjects(pengu);
        removeObjects(cliff);
        removeObjects(coin);
        removeObjects(monster);
        onCloud=false;
        a=1;
        shooting=false;
        List<Shooting> shooting=getObjects(Shooting.class);
        removeObjects(shooting);
        List<Door> door=getObjects(Door.class);
        removeObjects(door);
        List<DoorPost> doorPost=getObjects(DoorPost.class);
        removeObjects(doorPost);
        isDoor=false;
        List<ExtraLife> extraLife=getObjects(ExtraLife.class);
        removeObjects(extraLife);
        startToMove=false;
        move=false;
    }
    public void levelReset()
    {
        List<Platform> platform=getObjects(Platform.class);
        List<Boxes> box=getObjects(Boxes.class);
        List<Pengu> pengu=getObjects(Pengu.class);
        List<Cliff> cliff=getObjects(Cliff.class);
        List<Monster> monster=getObjects(Monster.class);
        List<Coin> coin=getObjects(Coin.class);
        List<Bullet> bullet=getObjects(Bullet.class);
        removeObjects(platform);
        removeObjects(bullet);
        removeObjects(box);
        removeObjects(pengu);
        removeObjects(cliff);
        removeObjects(coin);
        removeObjects(monster);
        onCloud=false;
        a=1;
        List<Shooting> shooting=getObjects(Shooting.class);
        removeObjects(shooting);
        List<Door> door=getObjects(Door.class);
        removeObjects(door);
        List<DoorPost> doorPost=getObjects(DoorPost.class);
        removeObjects(doorPost);
        isDoor=false;
        List<ExtraLife> extraLife=getObjects(ExtraLife.class);
        removeObjects(extraLife);
        startToMove=false;
        move=false;
    }
    public void simulation()
    {
        addObject ( new Cliff(), 50, 405);
        addObject ( new Cliff(3), 650, 405);
        
        addObject ( new Platform(4), 369, 315 );
        
        addObject ( new Pengu(), 46, 291 );
        
        addObject(new SnakeD(),650,302);
        addObject(new Block(2),141,270);
        addObject(new Block(2),141,310);
        addObject(new Block(2),181,310);
        addObject(new Block(2),221,310);
        addObject(new Block(2),261,310);
        addObject(new Block(2),261,270);
        addObject(new Snake(1),201,275);
    }
    public void levelUp()
    {
        if(level==1)
        level1();
        if(level==2)
        level2();
        if(level==3)
        {
            addObject(new Win(),375,325);
            addObject(new EndScore(),375,285);
        }
    }
    public void level1()
    {
        for(int j=20;j<481;j+=40)
        {
            for(int i=510;i<631;i+=40)
            {
                addObject(new Block(2),j,i);
            }
        }
        addObject(new Pengu(),192,470);
        for(int i=240;i<401;i+=40)
        {
            addObject(new Box(1),i,390);
        }
        addObject ( new Cliff(3), 658, 555);
        addObject(new SnakeD(),658,449);
        addObject(new Box(6),658,350);
        addObject(new Cliff(2),908,525);
        addObject(new Coin(),908,310);
        addObject(new Coin(),873,310);
        addObject(new Coin(),943,310);
        addObject(new Cliff(2),1243,525);
        addObject(new Platform(4),1076,450);
        for(int j=1362;j<1483;j+=40)
        {
            for(int i=510;i<631;i+=40)
            {
                addObject(new Block(2),j,i);
            }
        }
        for(int i=1362;i<1443;i+=40)
        {
            addObject(new Coin(),i,390);
        }
        addObject(new Box(2),1482,390);
        addObject(new Block(1),1679,439);
        addObject(new Cliff(3),1788,555);
        addObject(new Cliff(2),1942,525);
        addObject(new Snake(1),1942,360);
        for (int j=2105; j<2346; j+=40)
        {
            for (int i=486; i<647; i+=40)
            {
                addObject(new Block(3),j,i);
            }
        }
        addObject(new Door(),2292,433);
        addObject(new DoorPost(),2292,433);
    }
    private void levelAct()
    {
        if(level==1)
        level1Act();
        if(level==2)
        level2Act();
    }
    private void level1Act()
    {
        if(a==1)
        {
            addObject(new Creature(),440,390);
            a=3;
        }
    }
    private void level2()
    {
        levelReset();
        addObject(new Pengu(),60,470);
        int a=509;
        for(int j=-20;j<661;j+=40)
        {
            for(int i=630;i>a;i-=40)
            {
                if(j<301||j>381)
                {
                    addObject(new Block(2),j,i);
                }
            }
            if(j>381&&j<541)
            {
                a+=40;
            }
            else if(j>141&&j<261)
            {
                a-=40;
            }
        }
        for (int i=60;i<141;i+=40)
        {
            addObject(new Box(1),i,382);
        }
        for (int i=60;i<141;i+=40)
        {
            addObject(new Coin(),i,272);
        }
        addObject(new SnakeD(),660,519);
        addObject(new Platform(2),800,540);
        addObject(new Snake(1),300,358);
        for(int j=1062;j<1183;j+=40)
        {
            for(int i=630;i>470;i-=40)
            {
                addObject(new Block(2),j,i);
            }
        }
        addObject(new SnakeD(),1142,478);
        for(int i=1062;i<1183;i+=40)
        {
            addObject(new Coin(),i,340);
        }
        addObject(new Block(1),1294,461);
        addObject(new Block(1),1387,412);
        addObject(new Block(1),1487,501);
        addObject(new Block(1),1599,575);
        addObject(new Block(1),1681,440);
        addObject(new Cliff(4),1961,555);
        for(int i=2034;i>1988;i-=45)
        {
            addObject(new Snake(-2,2),i,447);
        }
        for(int i=1807;i<2116;i+=154)
        {
            addObject(new Box(4),i,354);
        }
        for(int i=1807;i<1913;i+=35)
        {
            addObject(new Coin(),i,239);
        }
        addObject(new Box(2),1961,239);
        for(int i=2010;i<2116;i+=35)
        {
            addObject(new Coin(),i,239);
        }
        int b=470;
        for(int j=2245;j<2726;j+=40)
        {
            for(int i=630;i>b;i-=40)
            {
                addObject(new Block(2),j,i);
            }
            if(j==2365)
            b-=120;
            else if(j==2405)
            b+=120;
            else if(j==2725)
            b-=120;
        }
        addObject(new Creature(),2400,440);
        int c=509;
        for(int j=2805;j<2966;j+=40)
        {
            for(int i=510;i>c;i-=40)
            {
                addObject(new Block(2),j,i);
            }
            if(j>2805)
            c=389;
        }
        int g=590;
        int h=509;
        for(int j=2765;j<3206;j+=40)
        {
            for(int i=g;i>h;i-=40)
            {
                addObject(new Block(4),j,i);
            }
            if(j==2765)
            h+=40;
            if(j>2925)  
            h-=40;
            if(j>2965)
            g-=40;
        }
        int d=629;
        for(int j=2765;j<3206;j+=40)
        {
            for(int i=630;i>d;i-=40)
            {
                addObject(new Block(2),j,i);
            }
            if(j>2965)
            d-=40;
        }
        int e=470;
        int f=389;
        for(int j=3005;j<3206;j+=40)
        {
            for(int i=e;i>f;i-=40)
            {
                addObject(new Block(2),j,i);
            }
            e-=40;
            if(j>3005)
            f-=40;
        }
        addObject(new SnakeD(),3100,359);
        for(int i=2765;i<2966;i+=40)
        {
            addObject(new Coin(),i,595);
        }
        for(int i=2885;i<3086;i+=40)
        {
            addObject(new Coin(),i,275);
        }
        for (int j=3305; j<3546; j+=40)
        {
            for (int i=486; i<647; i+=40)
            {
                addObject(new Block(3),j,i);
            }
        }
        addObject(new Door(),3492,433);
        addObject(new DoorPost(),3492,433);
    }
    private void level2Act()
    {
        if(addObjects<=addObjectsAt)
        {
        }
    }
    public void help()
    {
        addObject(new Help(),375,325);
    }
    public void help2()
    {
        List<Help> help=getObjects(Help.class);
        removeObjects(help);
    }
    private void test()
    {
        int a=359;
        for(int j=20;j<661;j+=40)
        {
            for(int i=480;i>a;i-=40)
            {
                if(j<301||j>381)
                {
                    addObject(new Block(2),j,i);
                }
            }
            if(j>381&&j<541)
            {
                a+=40;
            }
            else if(j>141&&j<261)
            {
                a-=40;
            }
        }
        
         
    }
}
This is the Pengu class which makes the move boolean be true (I don't think you need the Mover class):
import greenfoot.*;

/**
 * A little penguin that wants to get to the other side.
 */
public class Pengu extends Mover
{
    private static final int jumpStrength = 23;
    private int timer=0;
    private int delay=0;
    private static final int gunReload=5;
    public Pengu()
    {
        setImage(new GreenfootImage("pengu-right2.png"));
    }
    public void act() 
    {
        Scene scene=(Scene)getWorld();
        if(!scene.pause)
        {
            delay++;
            shoot();
            shooting();
            coins();
            checkKeys();       
            checkFall();
        }
    }
    
    private void checkKeys()
    {
        Scene scene=(Scene)getWorld();
        if (Greenfoot.isKeyDown("left")&&getX()>=20 )
        {
            scene.direction=false;
            if(!scene.shooting)
            {
                setImage("pengu-left2.png");
            }
            else if(scene.shooting=true)
            {
                setImage("pengu-left2Shooting.png");
            } 
            if(!touchingLeftSide())
            moveLeft();
        }
        changeMove();
        if (Greenfoot.isKeyDown("right")&&scene.move==false)
        {
            scene.direction=true;
            if(!scene.shooting)
            {
                setImage("pengu-right2.png");
            }
            else if(scene.shooting=true)
            {
                setImage("pengu-right2Shooting.png");
            }
            if(!touchingRightSide())
            {
               moveRight();
            }
        }
        if (Greenfoot.isKeyDown("up") )
        {
            if (onGround())
                jump();
        }
    }    
    
    private void jump()
    {
        Scene scene=(Scene)getWorld();
        setVSpeed(-jumpStrength);
        fall();
    }
    private boolean checkDoor()
    {
        return isTouching(Door.class)||isTouching(DoorPost.class);
    }
    private void checkFall()
    {
        if (onGround()) {
            setVSpeed(0);
            Actor under = getOneObjectAtOffset(0, getImage().getHeight()/2 , null);
            if(!checkDoor())
            {
                if(under!=null)
                {
                    int h=under.getImage().getHeight()/2+getImage().getHeight()/2-5;
                    int y=under.getY();
                    setLocation(getX(),y-h);
                }
            }
        }
        else {
            fall();
        }
        
    }
    private void coins()
    {
        Scene scene=(Scene)getWorld();
        Coin coin=(Coin)getOneIntersectingObject(Coin.class);
        if(coin!=null)
        {
            scene.removeObject(coin);
            scene.score=scene.score+100;
            scene.coins=scene.coins+1;
        }
    }
    private void changeMove()
    {
        Scene scene=(Scene)getWorld();
        scene.move = getX() >= 342 && ! scene.onCloud && ! touchingRightSide();
        if(scene.isDoor==true||getX()<342)
        {
            scene.move=false;
        }
    }
    private void shoot()
    {
        Scene scene=(Scene)getWorld();
        if(Greenfoot.isKeyDown("space")&&delay>=gunReload&&scene.shooting==true)
        {
            if(scene.direction==false)
            {
                scene.addObject(new Bullet(-7),getX()-26,getY());
            }
            if(scene.direction==true)
            {
                scene.addObject(new Bullet(7),getX()+26,getY());
            }
            delay=0;
        }
    }
    private void shooting()
    {
        Scene scene=(Scene)getWorld();
        if(isTouching(Shooting.class))
        {
            scene.shooting=true;
            removeTouching(Shooting.class);
        }
        if(scene.shooting)
        {
            if(scene.direction==false)
            {
                setImage("pengu-left2Shooting.png");
            }
            if(scene.direction==true)
            {
                setImage("pengu-right2Shooting.png");
            }
        }
        else if(!scene.shooting)
        {
            if(scene.direction==false)
            {
                setImage("pengu-left2.png");
            }
            if(scene.direction==true)
            {
                setImage("pengu-right2.png");
            }
        }
    }
}

    
This is the Boxes calss that the Block extends from:
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Boxes here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Boxes extends Actor
{
    /**
     * Act - do whatever the Boxes wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        // Add your action code here.
    }
    public void move()
    {
        Scene scene=(Scene)getWorld();
        Boxes box=(Boxes)getOneObjectAtOffset(-27,0,Boxes.class);
        
            if(Greenfoot.isKeyDown("Right")&&scene.move==true)
            setLocation(getX()+scene.moveSpeed,getY()); 
        
        /*else if(box!=null)
        {
            setLocation(box.getX()+40,getY());
        }*/
        if(scene.onCloud==true)
        {
            if(scene.way==true)
            {
                setLocation(getX()-4,getY());
            }
            if(scene.way==false)
            {
                setLocation(getX()+4,getY());
            }
        }
    }
    public void remove()
    {
        Scene scene=(Scene)getWorld();
        if(getX()<=-500)
        {
            scene.removeObject(this);
        }
    }
    private boolean moveBox()
    {
        Boxes boxes=(Boxes)getOneObjectAtOffset(-27,0,Boxes.class);
        return boxes!=null;
    }
}
This is the Block class, which is the side-scrolling object that they aren't staying exactly next to each other:
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Block here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Block extends Boxes
{
    private GreenfootImage image1=new GreenfootImage("Block.png");
    private GreenfootImage image2=new GreenfootImage("Bricks2.png");
    private GreenfootImage image3=new GreenfootImage("EndBricks.png");
    private GreenfootImage image4=new GreenfootImage("Tunnel.png");
    public boolean isThere=true;
    private boolean addObjects=false;
    public Block(int type)
    {
        if(type==1)
        {
            setImage(image1);
        }
        if(type==2)
        {
            setImage(image2);
        }
        if(type==3)
        {
            setImage(image3);
        }
        if(type==4)
        {
            setImage(image4);
            isThere=false;
        }
        if(type==5)
        {
            setImage(image1);
            addObjects=true;
        }
    }
    /**
     * Act - do whatever the Block wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        Scene scene=(Scene)getWorld();
        if(!scene.pause)
        {
            move();
            addObjects();
            remove();
        }
    }
    private void addObjects()
    {
        Scene scene=(Scene)getWorld();
        if(addObjects)
        {
            scene.addObjects=getX();
        }
    }
}
Above are all the classes that I think you will need (I didn't post them in the last post because I didn't have much time, so I would have thought that you can just look back at old discussions for these classes).
danpost danpost

2016/11/27

#
You might be able to get away with adding the Pengu object into the world first in every level. However, the real issue is that you have each object (block) scrolling themselves (which happens at different times) instead of the world scrolling all the objects at once (keeping everything with the same respect to each other).
Nosson1459 Nosson1459

2016/11/27

#
Well, that might be the problem, but not how to solve it (which was the original question).
danpost danpost

2016/11/28

#
Nosson1459 wrote...
Well, that might be the problem, but not how to solve it (which was the original question).
I suggested two ways in my last post -- try adding the Pengu object into the world first (before anything else) in all levels; or control the scrolling where it should really be controlled from (in your World subclass).
Nosson1459 Nosson1459

2016/11/28

#
I saw that in your last post but you're not saying how to move all block actors at once (even from the world). (How will adding the Pengu in first help, everything is being added in correctly either way, just when they move they split, and in the second level where the most earthquakes happen (most blocks) the Pengu is being added in first.)
danpost danpost

2016/11/28

#
Nosson1459 wrote...
How will adding the Pengu in first help, everything is being added in correctly either way, just when they move they split, and in the second level where the most earthquakes happen (most blocks) the Pengu is being added in first.)
It was just a thought (maybe not a very good one).
you're not saying how to move all block actors at once (even from the world)
Well, you will have to adjust a lot of your code to properly do it. Basically, you would program your Pengu object normally, without regard to the fact that there is scrolling going on (make it move and jump by the left/right and up keys); then, you would keep a reference to the Pengu object in the world class so that the world can determine when scrolling is needed (it can limit scrolling to anytime the Pengu object is past it normal right limit, and only when the right edge of the scrolling area is still not matched up with the right edge of the world window). If the following line is added to the classes of objects that are not to scroll:
public void setLocation(int x, int y) { }
then you can just move every object in 'getObjects(null)' the same distance to keep everything in line with respect to each other. The Scroller class code provided in an earlier thread can be reviewed for learning purposes (or used in your project, as is).
Nosson1459 Nosson1459

2016/11/28

#
i put in the scene class
private Pengu pengu;
then in level1
pengu=new Pengu();
addObject(pengu,int x,int y);
and it gave me a seemingly unrelated error in the error window
java.lang.NoClassDefFoundError: Scene
	at Menu.<init>(Menu.java:18)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at greenfoot.core.Simulation.newInstance(Simulation.java:607)
	at greenfoot.platforms.ide.WorldHandlerDelegateIDE$4.run(WorldHandlerDelegateIDE.java:445)
	at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:494)
	at greenfoot.core.Simulation.maybePause(Simulation.java:299)
	at greenfoot.core.Simulation.runContent(Simulation.java:212)
	at greenfoot.core.Simulation.run(Simulation.java:205)
Caused by: java.lang.ClassNotFoundException: Scene
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 11 more
java.lang.NoClassDefFoundError: Scene
	at Menu.<init>(Menu.java:18)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at greenfoot.core.Simulation.newInstance(Simulation.java:607)
	at greenfoot.platforms.ide.WorldHandlerDelegateIDE$4.run(WorldHandlerDelegateIDE.java:445)
	at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:494)
	at greenfoot.core.Simulation.maybePause(Simulation.java:299)
	at greenfoot.core.Simulation.runContent(Simulation.java:212)
	at greenfoot.core.Simulation.run(Simulation.java:205)
Caused by: java.lang.ClassNotFoundException: Scene
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 11 more
this is the code 4 the menu class
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Menu here.
 * 
 * @author (your name)
 * @version (a version number or a date)
 */
public class Menu extends World
{
    /**
     * Constructor for objects of class Menu.
     *
     */
    public Menu()
    {
        super(750,650,1,false);
        addObject(new Play(),200,192);
        addObject(new Controls(),200,458);
        setPaintOrder(Back.class,Help.class,Play.class,Controls.class);
        Greenfoot.start();
    }
}
danpost danpost

2016/11/28

#
This line does not look like an execution line:
addObject(pengu,int x,int y);
'int x' and 'int y' would be used in a method declaration line -- not in a method call.
Nosson1459 Nosson1459

2016/11/28

#
The question was how do declare the pengu variable, w/o getting that error, and to add an object using addObject u put wat ur adding and an x and y coordinate!!!!!!!!
danpost danpost

2016/11/28

#
Nosson1459 wrote...
!AAARGH!! The question was how do declare the pengu variable
What you have just shown above looks fine for that.
Nosson1459 Nosson1459

2016/11/28

#
danpost wrote...
What you have just shown above looks fine for that.
So what's with that error box, it only pops up when the coding for declaring the pengu variable is there? I closed the scenario and reopened it a few times and it started working.
Nosson1459 Nosson1459

2016/11/28

#
This is the side-scrolling method just made in scene:
private void sideScrolling()
    {
        move = pengu.getX() >= 342 && ! onCloud && ! pengu.touchingRightSide();
        if(isDoor==true||pengu.getX()<342)
        {
            move=false;
        }
        List<Actor> actors=getObjects(null);
        if(Greenfoot.isKeyDown("right")&&move==true)
        actors.setLocation(actors.getX()+moveSpeed,actors.getY());
    }
it cant find the actor methods (
danpost wrote...
The Scroller class code provided in an earlier thread can be reviewed for learning purposes (or used in your project, as is).
What's this talking about?)
danpost danpost

2016/11/28

#
The Scroller class code can be found here. In your code, 'actors' is a List object and there is no 'setLocation' method for a List object. See lines 131 through 135 of the class referenced here.
There are more replies on the next page.
1
2