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

2012/11/6

Methods

bigbird bigbird

2012/11/6

#
currently i'm coding a game, in which i need a time limit to be set, i have learned the code for that, however, i forgot how to create a new method within the documentation. how would this be done secondly, i need to be able to pick something up at one point , location a (or 'eat' it) and then be able to drop it off and location b. how would i write code to drop it off? thanks
danpost danpost

2012/11/6

#
This can help on making methods, which should be tackled first.
bigbird bigbird

2012/11/7

#
oKay thanks, any suggestions on code to use to have the 'people' dropped off at point b, after being picked up at point a?
danpost danpost

2012/11/7

#
If you are only picking up one Actor object at a time, you can add a field of type Actor to the class of the type object that is picking up the actor and initially set it to 'null'. When picking up the actor, set the field to that actor and remove that actor from the world. When dropping that actor back off at point b, add the actor back into the world and clear the field back to 'null'.
You need to login to post a reply.