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

Report as inappropriate.

yedefei
yedefei presents ...

2012/8/6

angle && mouse

make any changes to the original version(http://www.greenfoot.org/scenarios/4180),
click left button at any where, the tank will rotate gradually and then move towards the pointer,
click right button the cannon will fire to the target

5148 views / 1170 in the last 7 days

5 votes | 1 in the last 7 days

Tags: mouse demo with-source maths

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Mon Aug 06 10:44:48 UTC 2012 replace cat with tank
MorranMorran

2012/8/7

This is pretty cool! The tank just stays stationary until it is facing the target. What if it moved just a little, and as it faces more and more to the target, it moves faster and faster?
yedefeiyedefei

2012/8/7

呃,maybe you could try to fulfill it~ ^_^
09blackn09blackn

2012/8/11

when i open the project in greenfoot it cant compile because of this turnTowards(thatX, thatY); any ideas
yedefeiyedefei

2012/8/11

it seems the turnTowards() method was nearly added into the API of Actor . you may download the latest Greenfoot version and try again.
CodexCodex

2012/8/21

can i ask for the source code please?
danpostdanpost

2012/8/21

@Codex, above and to the right of the scenario window, you will see a large green button that says 'Open in Greenfoot'. Click on it to download the scenario. Move the scenario to a place you can read-write (your 'scenarios' folder would be the appropriate place). Then open that file up while running Greenfoot. You can open the source for the classes and view the code.
Nasman2.0Nasman2.0

2013/2/20

could you paste the coding for the mouse click here? i downloaded it yesterday it worked fine, i deleted then realized i needed it and it doesn't work now. i keep trying to download it but only a gfar file comes up not a cat lan (or something or other) folder.
Nasman2.0Nasman2.0

2013/2/20

turns out i had to open from greenfoot. didn't work yesterday
Greenfoot2022Greenfoot2022

2022/11/29

nice

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

Who likes this?

Greenfoot2022 weilipan Busch2207 CrazyGamer1122 Morran