加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CrabWorld.java 882 Bytes
一键复制 编辑 原始数据 按行查看 历史
sakura 提交于 2021-04-29 16:38 . crab.java
import greenfoot.*; // (Actor, World, Greenfoot, GreenfootImage)
public class CrabWorld extends World
{
/**
* Create the crab world (the beach). Our world has a size
* of 560x560 cells, where every cell is just 1 pixel.
*/
public CrabWorld()
{
super(560, 560, 1);
Crab c = new Crab();
Lobster l1 = new Lobster();
Worm w1 = new Worm();
Worm w2 = new Worm();
Worm w3 = new Worm();
Worm w4 = new Worm();
Worm w5 = new Worm();
Worm w6 = new Worm();
addObject(c,120,120);
addObject(l1,1,20);
addObject(w1,150,120);
addObject(w2,200,120);
addObject(w3,100,120);
addObject(w4,500,120);
addObject(w5,400,50);
addObject(w6,450,60);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化