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

2014/3/22

Is there a way to set actors so they cannot be moved with the mouse?

blorange2 blorange2

2014/3/22

#
I have a scenario in which i want the actors to be fixed in certain positions, can this be done?
erdelf erdelf

2014/3/22

#
just dont move them `?
blorange2 blorange2

2014/3/22

#
Perhaps you have misunderstood me When I pause the scenario. I am able to use the mouse to move the objects around the world?
danpost danpost

2014/3/22

#
You can either use the 'act' method of all those actors to 'setLocation' them where you want them; or in your world class, use the 'started' method to 'setLocation' them where you want them. With the world 'started' method you will need references to each actors and the coordinates in the 'setLocation' call can be literal; with the actor 'act' method you will need the coordinates saved in fields for the 'setLocation' call to use (if you only create one of that type actor, they can be literal here, also).
You need to login to post a reply.