Hello all,
I have been trying to implement danposts Scrolling Super World in my game. I get an error in danposts code for some reason (I have not altered it) so I must have made an error in my other code.
Here is my subclass of SWorld
When I compile SWorld gives me an error
So either I have not fully understood what to do and made a mistake somewhere or... no that seems likely.
So does anybody have any idea's?
import greenfoot.*; // public class Level1 extends SWorld { public Level1() { this (new Alice()); } public Level1(Alice alice) { super(600, 400, 1, 1000); //Player setMainActor(new Alice(),300,200); mainActor.setLocation(10, 340); //Background GreenfootImage bg = new GreenfootImage("Test.jpg"); setScrollingBackground(bg); //Counter addObject(new Score(), 30, 10, false); addObject(new ShroomScore(), 130, 10, false); //Level blocks for(int i=1;i<30;i++) { addObject(new Block(), i*30-15, 384, true); } // objects addObject(new Heart(),400,350, true); addObject(new Barrel(),200,350, true); addObject(new Shroom(), 250,300, true); //Enemy addObject(new Walker(),600,350, true); //Detector addObject(new RDetector(), 700,350, true); addObject(new LDetector(), 500,350, true); addObject(new LevelDetect(), 795, 400, true); } }
for(Object obj : genActors) { Actor actor=(Actor)obj; actor.setLocation(actor.getX()+dxSum, actor.getY()+dySum); }
Greenfoot Error wrote...
incompatible types
(genActors is highlighted red)