下载此文档

安卓教程:植物大战僵尸向日葵.docx


文档分类:中学教育 | 页数:约10页 举报非法文档有奖
1/10
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/10 下载此文档
文档列表 文档介绍
植物大战僵尸向日葵
定义一个向日葵的类,向日葵每隔 10 秒产生的太阳也是一个类。
【文件 3-14】
.;
.;
.;
.;
.;
public class SunPlantextends ProductPlant {
publicSunPlant() {
super("image/plant/sunflower/");
life =100;
baseAction();
create();
}
***@Override
publicvoidcreate() {
//每隔 10 秒产生一个阳光
().schedule("create", this,10,false);
}
/**
* 产生阳光
* ***@paramf
*/
publicvoidcreate(float f) {
newSun((), , ccp(getPosition().x, getPosition().y + 40)
,ccp(getPosition().x+ 25,
25.
getPosition().y));
}
***@Override
publicvoidbaseAction() {
("image/plant/sunflower/p_1_%", 8
, true);
runAction(animate);
}
}
【文件 3-15】
.;
.;
.;
.;
.;
.;
.;
.;
.;
.;
.;
.;
.;
.;
.;
import ;
/**
*阳光
*/
public class Sunextends Product {
publicstaticfinal CopyOnWriteArrayList<Sun>suns= new
CopyOnWriteArrayList

安卓教程:植物大战僵尸向日葵 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数10
  • 收藏数0 收藏
  • 顶次数0
  • 上传人253043948
  • 文件大小675 KB
  • 时间2018-04-02