I'm new in this programing language, but using the internet I am trying to make a game, but now i'm stuck at this point and it's so annoying.
public class ker1 extends Actor
{
/**
* Act - do whatever the ker1 wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
int stone_speed = 4;
setLocation( getX() - stone_speed, getY() );
if (getX()==0) getWorld().removeObject(this);
updateImage();
}
private void updateImage()
{
setImage(new GreenfootImage("" + getSplashes()[Greenfoot.getRandomNumber(getSplashes().length)], 20, null, null));
}
public static String[] getSplashes()
{
String[] splashes = {"cin>>a;", "cin>>b;", "cout<<boop;","cin>>a;","cout<<3;","cout<<a+b;","cout<<23;","cin>>n;","cin>>prim2;",
"cout<<a<<9;"};
return splashes;
}
}
