I changed it to double and it no longer has an error, disregard this :D.
I'm working on adding a few things to the asteroid game I made a while back.
What I'm doing is keeping track of the score in the actor that the player controls. My goal is the following:
Working: When the ball hits the asteroid, it does castle.addDestroyed(); which adds 1 to the value
Not working: When the asteroid spawns, it determines its speed based on the square root of castle.getDestroyedCount(); which looks like this:
When I try to compile it says "cannot return a value from method whose result type is void"
Is that because this is a public void? What other types are there? Should I set it to double, since that's what destroyedCount is?
Anyway, is this the most efficient way to do it? Keep score somewhere persistent, access it when needed?
public void addDestroyed() { destroyedCount = (destroyedCount + 1); }
public void getDestroyedCount() { return destroyedCount; }