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

Report as inappropriate.

Dzifzar
Dzifzar presents ...

2012/11/30

Adventure of Spith - need help please!

Hey there, i'm trying to do a test where link runs around, if he hits the green, he stops moving. I can't seem to access the class "Tiles"' colors, and i'm not quite sure how to do this. If someone could just help with the collision detection code (if color is more green than blue) is the only thing i'm having trouble with. Thanks!!!!

2146 views / 596 in the last 7 days

Tags: with-source help overhead

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Fri Nov 30 06:58:11 UTC 2012
danpostdanpost

2012/11/30

Cannot help without source code.
MatheMagicianMatheMagician

2012/11/30

You could use the getBlue() and getGreen() methods outlined here: http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Color.html#getRed() An example of this would be: if(color.getGreen()>color.getBlue()) //stop
A new version of this scenario was uploaded on Fri Nov 30 15:47:03 UTC 2012
A new version of this scenario was uploaded on Fri Nov 30 15:47:33 UTC 2012 Updated source code
A new version of this scenario was uploaded on Wed Dec 05 02:51:13 UTC 2012 I've fixed the color detection, but I have no idea how to Start new worlds at different spots in each world. for instance, when going back down the stairs i would come out at the top, where you enter the first time, not back down the stairs. If anyone could help that would be great!! Thanks

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

Who likes this?

No votes yet.