Sorry for disturbing you at this time but for some reason when i want to call a method from another class (im using BlueJ btw.) it says Non-static method Licht_an (or light on in English) cannot be referenced from a static context. My friends at school did the exact same thing at it worked for them just not for me.
first code is part of the main class the second is part of the second class
public void tastaturSteuerung(){
while(!tastatur.istGedrueckt(' ')){
if(tastatur.rechts()){
kamera.verschiebe(1,0,0);
}
if(tastatur.links()){
kamera.verschiebe(-1,0,0);
}
if(tastatur.unten()){
kamera.verschiebe(0,0,1);
}
if(tastatur.oben()){
kamera.verschiebe(0,0,-1);
}
if(tastatur.tab()){
kamera.verschiebe(0,-1,0);
}
if(tastatur.shift()){
kamera.verschiebe(0,1,0);
}
if(tastatur.istGedrueckt('l')){
Sys.warte(1);
MeinHaus.Licht_an();
}
}
}
---------
public void Licht_an(){
for(int i=0; i<4; i++){
gartenlampelinks[i].setzeFarbe(1,1,0);
gartenlamperechts[i].setzeFarbe(1,1,0);
}
for(int i=0; i<=1; i++){
gartenlampeoben[i].setzeFarbe(1,1,0);
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…