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

Report as inappropriate.

nccb
nccb presents ...

2012/7/6

Shooting Rocks

This is a rework of the asteroids scenario from the book, to use point-circle intersection rather than Greenfoot's built-in collision detection. See this page for an explanation:

http://sinepost.wordpress.com/2012/07/06/shooting-rocks/

6016 views / 23 in the last 7 days

1 vote | 0 in the last 7 days

Tags: with-source

open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

zapnine7zapnine7

2012/7/6

Great! A very simple example with the Pythagorean theorem. I also have a sort of request... In eclipse there are no handy methods like "move" and "turn", so could you post the maths behind rotating an image, like Greenfoot does?
nccbnccb

2012/7/6

The gist of rotating an image is that if you want a 30 degree clockwise rotation, then for each position in the new image, you rotate the position by 30 degrees anti-clockwise and, use the pixel from the old image that is at that position. I can add the idea to my list, but I have a bit of a pipeline going, so it will be a while before it shows up :)
zapnine7zapnine7

2012/7/6

Not sure what you mean, but I'll that one sentence for many hours... Maybe I'll figure it out :) Thanks anyways! You blog is something I check everyday!
nccbnccb

2012/7/7

It's very similar to this post: http://sinepost.wordpress.com/2012/04/10/burning-rubber/ That post looks at rotating the position of the wheel to work out where to place the tyre tracks. But instead of rotating a wheel position, you rotate the position of every pixel in the image. As I said, I will write the full post for you soon :)
MatheMagicianMatheMagician

2012/7/12

Hey, thanks for the post on burning rubber. I was having tons of difficulty calculating the next point on a circle. Yo helped me figure it out. I will hopefully be using it to make my cube program actually work.
nccbnccb

2012/7/24

zapnine7: I've now published the explanation of how to do image rotation, you can find it here: http://sinepost.wordpress.com/2012/07/24/image-rotation/
zapnine7zapnine7

2012/7/24

Wow! Thanks so much! I really appreciate it. MatheMagician, your new picture is awesome.
MatheMagicianMatheMagician

2012/7/24

Thanks Zapnine, and thanks nccb.
strobez2006strobez2006

2014/4/18

This is awesome!

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

Who likes this?

zapnine7