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

2017/11/23

marbel game

vbh vbh

2017/11/23

#
Hi after updating greenfoot to the latest version, i get an erro in the marbel game it cant find getObjects(GoldMarble.class) the code is in the bord class private Marble getGoldMarble() { List<Actor> marbles = getObjects (GoldMarble.class); if (marbles.size() == 0) { return null; } else { return (Marble) marbles.get(0); } } do you have an solution? thanks
danpost danpost

2017/11/23

#
Change this line:
List<Actor> marbles = getObjects (GoldMarble.class);
to
List<GoldMarble> marbles = getObjects (GoldMarble.class);
or
List<? extends Actor> marbles = getObjects (GoldMarble.class);
vbh vbh

2017/11/23

#
ty for your quick replay
You need to login to post a reply.