Sign Up, Lost Password
Comments for Missile Command
Return to Missile Command
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
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.
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).
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!
*software = sophomore
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.
@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.
Thank you guys! I'll post all further questions to the discussion forum. Thanks!
@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.
this game is trash, make it more like call of duty, this is reallly bad SMH
awesome game !!!!!!!!!!!!!!!!!!!!!!! though
i hate it