黑马程序员安卓教程:植物大战僵尸向日葵.docxVIP

  • 2
  • 0
  • 约4.61千字
  • 约 5页
  • 2019-07-07 发布于江苏
  • 举报

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

植物大战僵尸向日葵 定义一个向日葵的类,向日葵每隔 10 秒产生的太阳也是一个类。 【文件 3-14】 SunPlant.java package com.itheima.pvzhm.domain; import org.cocos2d.actions.CCScheduler; import org.cocos2d.actions.base.CCAction; import com.itheima.pvzhm.domain.base.ProductPlant; import com.itheima.pvzhm.util.CommonUtil; public class SunPlantextends ProductPlant { publicSunPlant() { super(image/plant/sunflower/p_1_01.png); life =100; baseAction(); create(); } @Override publicvoidcreate() { //每隔 10 秒产生一个阳光 CCScheduler.sharedScheduler().schedule(create, this,10,false); } /** * 产生阳光 * @paramf */ publicvoidcreate(float f) { newSun(this.getPare

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档