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

Report as inappropriate.

trimil
trimil presents ...

2013/9/4

Streching Dots

What to do:
Click run to start.
Watch the green foot draw dots and
the dots strech

4140 views / 17 in the last 7 days

5 votes | 0 in the last 7 days

Tags: with-source dot

open in greenfoot
Your browser does not support the canvas tag.
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

See all comments

Want to leave a comment? You must first log in.

Who likes this?

FlyingRabidUnicornPig Draymothisk Game/maniac K_wow MatheMagician