Hallo,
Ich bekomme folgende Fehlermeldung:non static method scale(int,int) cannot be referenced from a static context wenn ich das hier Compiliere:
Mit
geht es auch nicht, dann sagt er cannot find variable GreenfootImage
MfG Gamma
Ich bekomme folgende Fehlermeldung:non static method scale(int,int) cannot be referenced from a static context wenn ich das hier Compiliere:
Java:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.util.*;
import java.awt.*;
import java.awt.event.*;
/**
* Write a description of class Orange here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Orange extends Spinne
{
public void Orange(){
if(z%5 == 0){
for(int a = 255;a>=0;a--){
GreenfootImage.scale(a,200);
}
Random r = new Random();
int b = Math.abs(r.nextInt()) % 10;
Random s = new Random();
int c = Math.abs(s.nextInt()) % 10;
setLocation(b,c);
z = z+1;
}
}
/**
* Act - do whatever the Orange wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
Orange();
}
}
Mit
Java:
Orange o = new Orange();
//Und dann
o.GreenfootImage.scale(a,200)
MfG Gamma