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

Kartoffelbrot's Comments

Back to Kartoffelbrot's profile

Write an e-mail to paul.bittner@gym-lachendorf.de.
I didn't meant it that way. whatIShouldDo() is supposted to replace the act method. It should be placed in cutActor, but it should be empty. The act method in cutActor should call it. So the subclassses will never use act. They use whatIShouldDo(). So the act method of the sublclass will be used every act, but because they haven't any the act method of the subclass (cutActor) will be used, which calls whatIShouldDo().
Zooming is endless , isn't it?
I saw your code now. Very nice solution. Maybe it would be easier to make a new method "whatIshouldDo" (only with a better name) in cutActor, which is used in the act method of cutActor. So the subclasses would use whatIShouldDo", by overwriting it, instead of using the act method. So you dont have to write super.act() everytime. Maybe it's easier, especially for larger scenarios. The subclasses can't use the act method if you make it private, but I am not sure if they would use the act method of Actor instead. It's only an idea, no problem if you don't like it.
@ SPower: 1.) Thank you 2.) I think you are right. @ Aermus: Sorry for spaming.
@ SPower: Thanks for your explanation, but I know it :). I didn't thought of it for a long time, too and had no idea what it should be useful for. So I implemented it very late.
@ SPower: You are right, that it can't be displayed. I didn't implemented in for long time in Tiny Tank. But as I've done it a few weeks ago, there was a huge difference. For example: If my tank has a rotation of about 5 degrees he is only moving to the right and not changing it's y coordinate. That was very ugly because he was a kind of drifting. As I implemented the double values the little numbers for the y movement by 5 degrees rotation were saved in the double values instead of being 0 every time. So the tank moves now exactly into the direction it faces, now. It wasn't a matter of speed only of precision... and uglyness :)
They are Actors.
What's that?