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

2013/4/24

Asteroid

1
2
a parameter is something you put in a method. For example, at the top of this discussion, your parameter for you fire method is "boolean isTorpedo". The error you were getting was saying that your fire method takes no parameters (meaning you must have erased "boolean isTorpedo") but you were trying to put one in anyways...
JetLennit wrote...
His fire does have a boolean
Yes, at the top of the discussion, but the error he's getting says he doesn't...
danpost danpost

2013/4/25

#
If he is getting that error message, then the 'fire(boolean)' method is not in the class it is being called from or in a super-class of that class.
infant17 infant17

2013/4/25

#
declaring the Boolean type for fire gives me another error message saying cannot find symbol variable reloadTime
infant17 infant17

2013/4/25

#
I don't know if Im making this more complicated than it actually is but what would be the simplest code to writeto avoid theso much errors where the rocket is able to shoot photon torpedos by pressing the letter p...and the photon torpedo completely destroys just one asteroid.
danpost danpost

2013/4/25

#
Without looking at what you already have, simply put, the Rocket class should have the code to detect the 'p' keystroke and 'fire' a photon torpedo; and the Torpedo class should detect asteroids and remove any asteroid and itself on a hit and remove itself at world edge.
infant17 wrote...
declaring the Boolean type for fire gives me another error message saying cannot find symbol variable reloadTime
If you are getting cannot find on 'reloadTime', then you do not have it declared in that class or in one of its super-classes (it is possible that this was already a problem, but it found the previous error first and did not have a chance to find this error because it had not gotten to it yet).
You need to login to post a reply.
1
2