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

Comments for Streching Dots

Return to Streching Dots

That is a pretty cool effect! I hope you release more scenarios like this!
It is incredible how one can make such a unique effect with only a few lines of code :)
danpostdanpost

2013/9/5

It would only take one or two random choices to produce added effect. Try this for the Dot constructor: public Dot() { setImage(new GreenfootImage(15, 15)); getImage().drawRect(Greenfoot.getRandomNumber(2)==0?img.getWidth()-2:0, Greenfoot.getRandomNumber(2)==0?img.getHeight()-2:0, 1, 1); }
danpostdanpost

2013/9/5

Sorry, both 'img' in the above should be 'getImage()'.
trimiltrimil

2013/9/5

Good ideas, but i don't no how to update it.
danpostdanpost

2013/9/5

Updating a scenario is done pretty much the same as uploading it to begin with. As long as you do not change the Scenario name in the dialog box.
A new version of this scenario was uploaded on Fri Sep 06 11:02:04 UTC 2013
trimiltrimil

2013/9/6

Thanks
A new version of this scenario was uploaded on Fri Sep 06 22:00:55 UTC 2013 Better code
A new version of this scenario was uploaded on Fri Sep 06 22:06:01 UTC 2013 Better code. Renamed class "Symbol" as "GreenFoot".
A new version of this scenario was uploaded on Sun Jun 29 12:40:25 UTC 2014 Movement of Green Foot is now also random
A new version of this scenario was uploaded on Sun Jun 29 14:06:45 UTC 2014 Changed code to allow multiple GreenFoot instances