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

2019/2/15

Adjust position of one actor

xandreas_1 xandreas_1

2019/2/15

#
Hi guys, I am using the scroller code of danpost. there is this:
for (Object obj : world.getObjects(null))
        {
            Actor actor = (Actor) obj;
            actor.setLocation(actor.getX()-dsx, actor.getY()-dsy);
        }
How can I change it, that just two Actor objects are moving?
danpost danpost

2019/2/16

#
xandreas_1 wrote...
Hi guys, I am using the scroller code of danpost. there is this: << Code Omitted >> How can I change it, that just two Actor objects are moving?
One possible way is changing line 4 to:
if (actor instanceof <<  Class name one >> || actor instanceof << Class name two >>) actor.setLocation(<< ... >>);
xandreas_1 xandreas_1

2019/2/16

#
Thx SIr :D
You need to login to post a reply.