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

Report as inappropriate.

MathManiac
MathManiac presents ...

2011/4/6

WaterMaker

I actually made this a long time ago, but it failed by I don't know why. The day this was published, I found out why. Greenfoot.getMouseInfo() was returning null becuase either it was out of the scenario, or it didn't move. So, I captured it with try/catch blocks and smartly programmed the scenario so if it does show an exception, it tries again with the PREVIOUS MouseInfo that didn't show null.

INSTRUCTIONS
Mouse - Directs water to where it starts
Space - Pauses the scenario

3782 views / 1047 in the last 7 days

2 votes | 0 in the last 7 days

Tags: mouse simulation with-source

open in greenfoot
Your browser is ignoring the <APPLET> tag.
kiarockskiarocks

2012/7/25

This is amazing! Is it ok to use it for one of my scenarios?
MathManiacMathManiac

2012/9/15

Sure

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

Who likes this?

JetLennit kiarocks