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

2014/6/30

Remove object

Meinersjee Meinersjee

2014/6/30

#
Is it possible to remove an actor when he comes at the location 0, 2 (for example) And which code do I need?
danpost danpost

2014/6/30

#
Anytime you ask a question and the word 'when' is involved, you are really saying 'if ever'. The ever part is dealt with just by using the 'act' method, which is repeatedly being run throughout the execution of your project as long as the actor is in the world (the actor would need to be in the world to reach those coordinates anyway). So, your statement is this: if location of actor is (0, 2), remove it from the world; Do you know how to get the location of the actor? Do you know how to have the actor remove itself from the world which it is in? Can you now take the statement and make meaningful code from it?
You need to login to post a reply.