代码拉取完成,页面将自动刷新
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Lobster here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Lobster extends Actor
{
/**
* Act - do whatever the Lobster wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
int f=1;
public void act()
{
// Add your action code here.
move(4);
more();
eat();
}
public void more(){
int dgree = Greenfoot.getRandomNumber(30);
turn(dgree-15);
}
public void eat(){
if(isTouching(Crab.class)){
removeTouching(Crab.class);
CrabWorld world =(CrabWorld)getWorld();
f=0;
world.abc2(f);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。