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

2011/5/27

creating coins that continuously show up?

lydialydialydiaz lydialydialydiaz

2011/5/27

#
How do you create a method that continuously constructs coins in your world for your object to pick up without running an infinite loop? (I'm working on a world that is side scrolling and I want the coins to show up from right to left until my object dies or the level ends.)
Builderboy2005 Builderboy2005

2011/5/27

#
How often do you want a new coin to show up?
davmac davmac

2011/5/28

#
I think the question belies a misunderstanding. I think you don't need a "method that continuously constructs coins", you just want to construct a coin continuously; so for instance you could write a method that constructed a single coin, and then call it from the act() method, which gets called continuously.
You need to login to post a reply.