Skip to content

Instantly share code, notes, and snippets.

@chopmann
Created October 5, 2013 12:39
Show Gist options
  • Save chopmann/6840455 to your computer and use it in GitHub Desktop.
Save chopmann/6840455 to your computer and use it in GitHub Desktop.
public int removePlant(int x, int y) {
if (plantContainer[x][y] <= 0) {
plantContainer[x][y] = 0;
return 0;
} else {
plantContainer[x][y]--;
return plantEnergy;
}
}
plantEnergy ist ein variabler wert, aber er ist teil der Welt und nicht wirklich teil der Planzen.
Man kann es später ändern wenn man möchte, zB wenn man möchte das die Pflanzen mehr Energie liefern,
aber wie ich schon gesagt habe. Die Pflanzen sind bei dieser Aufgabe keine echte "Objekte".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment