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

Comments for Missile Command

Return to Missile Command

FizzwerthFizzwerth

2016/5/24

Nice, good job!
A new version of this scenario was uploaded on 2016-05-24 19:04:30 UTC published source code for you guys
SPowerSPower

2016/5/24

Not bad! :) Though it'd be nice if pressing multiple keys at once would make it move diagonally (i.e. w + a --> towards the top left). You'll simply need to check all the keys in separate if-statements, instead of making it 'else if' clauses, and then use setLocation(getX() +something, getY() +somethingelse), depending on whether you're moving to the left, right, up or down.
SPowerSPower

2016/5/24

Though you don't necessarily need to change the code for actually moving it, but it would be easier in my opinion (plus, less CPU intensive: rotating, though you don't notice it here, can be costly).
DStasiakDStasiak

2016/5/24

This app was created by an awesome software at Legend High School in Parker Colorado. Thank you for all the comments and feedback. Does anyone know how to get the missiles to follow the rotation set for each? In other words, he was having issue getting the missiles to move towards the set rotation. That is why the end looks funny. Ideally, the missiles would go the direction the end piece is pointing. He was unable to get anything other than 45 degree angles or straight. I can't figure it out. Thanks!
DStasiakDStasiak

2016/5/24

*software = sophomore
SPowerSPower

2016/5/24

The move method in actor should do that. But for further Greenfoot questions, please create a discussion - that's how thing are kept tidy around here.
danpostdanpost

2016/5/24

@DStasiak, for the missile movement, there are a couple of ways to handle it. One is to track the coordinate locations using 'double' fields (greenfoot uses 'int' fields which is why only multiples of 45 are achieved when moving one pixel at a time). The other way is to have the missiles hold their starting location and count the steps it takes so you can increment the step, relocate back to the original location and move a greater distance each time.
DStasiakDStasiak

2016/5/24

Thank you guys! I'll post all further questions to the discussion forum. Thanks!
danpostdanpost

2016/5/24

@DStasiak, I just updated my Global Defense game to allow users to view class codes without having to be logged in on the site. You may want to view the Missile class code in it.
wow_manxxxWowwow_manxxxWow

2016/5/25

this game is trash, make it more like call of duty, this is reallly bad SMH
NAMYA0303NAMYA0303

2016/9/5

awesome game !!!!!!!!!!!!!!!!!!!!!!! though
TueCoolTueCool

2016/9/15

i hate it