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

Report as inappropriate.

winkleden
winkleden presents ...

2011/11/12

Tanks

Player one (The right tank)
use WASD to move and turn

z to shoot

Player two (The Left tank)
arrow keys to move and turn

. (period) to shoot

Have fun!!!

3183 views / 12 in the last 7 days

Tags: with-source

open in greenfoot
Your browser does not support the canvas tag.
bournebourne

2011/11/12

Good work. Keep it up! You can make the tanks move in more precise direction when keeping a set of double's for its position in which case you do the following when provoked to move forward, and similarly applied to the shells: private double x, y; private int speed = 1; public void act() { if (Greenfoot.isKeyDown("w")) // key for moving a tank forward { x += Math.cos(Math.toRadians(getRotation())) * speed; y += Math.sin(Math.toRadians(getRotation())) * speed; setLocation((int)x, (int)y); } } public void addedToWorld(World world) { x = getX(); y = getY(); }
THIS GAME BLOWWWWSSS!!
bournebourne

2011/11/14

Scenario's posted don't have to be spectacular. They are projects, usually in progress to become better and to learn from. If you don't have any constructive criticism to contribute, please don't criticize at all.
4xtra4xtra

2012/1/8

great concept keep working on detail like turning on the steer This is different than the others Attention haters: WHAT CAN YOU DO? Please log off with the ignorance....

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

Who likes this?

No votes yet.