The method declaration lies within Race.Java
Quote:
//Justerer eller returnerer spillerens liv
public int fixliv(int a)
{
if(a!=0)
{
//Giver spilleren a mere i liv
liv = liv + a;
System.out.println("Du har nu " + liv + " i liv");
}
else
{
//Returnerer værdien af liv
return liv;
}
return 0;
}
|
First it gets called in Race.java
Then I declare a new instance of the class Race in Sted.java:
Quote:
//Race
//Opret et objekt af klassen Race
Race race = new Race();
|
And then I call it in Sted.java: