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

2136 views / 8 in the last 7 days

2 votes | 0 in the last 7 days

Tags: mouse simulation with-source

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