当前位置: 首页 > news >正文

云服务器 做网站福州seo优化排名推广

云服务器 做网站,福州seo优化排名推广,网站用什么语言做,做权重网站敌机产生&玩家发射子弹 敌机产生: 创建一个空节点 创建一个敌机预制体 把敌机图片拖入预制体内 使用代码生成敌机 让敌机动起来 创建一个预制体enemy_prefab双击预制体enemy_prefab,然后拖入一个敌机图片,设置好方向和尺寸,一定要记得保存然后关闭(场景编辑器里面的保存)…

敌机产生&玩家发射子弹

敌机产生:
创建一个空节点
创建一个敌机预制体
把敌机图片拖入预制体内
使用代码生成敌机
让敌机动起来

  1. 创建一个预制体enemy_prefab
  2. 双击预制体enemy_prefab,然后拖入一个敌机图片,设置好方向和尺寸,一定要记得保存然后关闭(场景编辑器里面的保存)
    在这里插入图片描述
  3. 创建一个空节点enemy_node
  4. 创建一个脚本root.ts和root_node绑定
  5. root.ts添加 两行代码,保存
`   @property(Node) enemy_node: Node;   @property(Prefab) enemy_prefab: Prefab;  `

在这里插入图片描述
6. 选中root_node节点 绑定节点和预制体, 保存
在这里插入图片描述
7. root.ts代码

import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
const { ccclass, property } = _decorator;@ccclass('root')
export class root extends Component {@property(Node) enemy_node: Node;   // 添加属性 以便在代码中引用 敌人节点@property(Prefab) enemy_prefab: Prefab;   // 添加属性 以便在代码中 动态生成 敌人start() {this.createEnemies(); //使用定时器生成敌机}update(deltaTime: number) {}createEnemies() {this.schedule(() => {this.createOneEnemy();}, 1);}// 创建一个敌机createOneEnemy() {// console.log("createOneGold !");const enemyPrefab = instantiate(this.enemy_prefab);   // 实例化一个对象 (动态生成)this.enemy_node.addChild(enemyPrefab);     // 将对象 添加到某个 节点内let x = (Math.random() * 360)   // random() 0-360 enemyPrefab.setPosition(180 - x, 350);  // 设置敌机的Y坐标console.log("enemyPrefab: " + (180 - x) + "   y" + 350);}}

运行,飞机出来了,就是不会动
在这里插入图片描述
8. 让敌机飞
①创建Enemy.ts
②Enemy.ts和enemy_node节点绑定
③ 编写enemy.ts代码

import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;@ccclass('Enemy')
export class Enemy extends Component {start() {}update(deltaTime: number) {const enemy_list = this.node.children;let need_destroy =[];for (let i = 0; i < enemy_list.length; i++) {const pos  = enemy_list[i].getPosition();if (pos.y < -400) {need_destroy.push(i);}else{enemy_list[i].setPosition(pos.x, pos.y - 10);}}for (let j = 0; j < need_destroy.length; j++) {const index =  need_destroy[j];enemy_list[index].destroy(); //销毁对象}}
}

然后运行 飞机就能飞了
在这里插入图片描述


文章转载自:
http://lycopodium.qrqg.cn
http://oriole.qrqg.cn
http://typhlitis.qrqg.cn
http://cesti.qrqg.cn
http://extrahepatic.qrqg.cn
http://phonemics.qrqg.cn
http://mischief.qrqg.cn
http://buret.qrqg.cn
http://warehouse.qrqg.cn
http://subdolous.qrqg.cn
http://hoarder.qrqg.cn
http://euphemistic.qrqg.cn
http://tannoy.qrqg.cn
http://inaudibility.qrqg.cn
http://honoree.qrqg.cn
http://fogdrop.qrqg.cn
http://bowyang.qrqg.cn
http://disyllable.qrqg.cn
http://suitcase.qrqg.cn
http://cardinalate.qrqg.cn
http://chineselantern.qrqg.cn
http://hectostere.qrqg.cn
http://skinniness.qrqg.cn
http://fibrillated.qrqg.cn
http://topocentric.qrqg.cn
http://dipsey.qrqg.cn
http://prefade.qrqg.cn
http://museque.qrqg.cn
http://entente.qrqg.cn
http://authentification.qrqg.cn
http://allergen.qrqg.cn
http://floreat.qrqg.cn
http://promin.qrqg.cn
http://polemic.qrqg.cn
http://impairer.qrqg.cn
http://iguana.qrqg.cn
http://gypsography.qrqg.cn
http://dipsophobiac.qrqg.cn
http://sudetenland.qrqg.cn
http://rhinogenic.qrqg.cn
http://sourly.qrqg.cn
http://runch.qrqg.cn
http://bundle.qrqg.cn
http://hindquarter.qrqg.cn
http://bargainer.qrqg.cn
http://proposition.qrqg.cn
http://cinchonism.qrqg.cn
http://diomed.qrqg.cn
http://metadata.qrqg.cn
http://leafstalk.qrqg.cn
http://diosmosis.qrqg.cn
http://colluvium.qrqg.cn
http://grievance.qrqg.cn
http://debarment.qrqg.cn
http://stacker.qrqg.cn
http://hrvatska.qrqg.cn
http://euterpe.qrqg.cn
http://unpopular.qrqg.cn
http://putter.qrqg.cn
http://spaceworthy.qrqg.cn
http://chinaware.qrqg.cn
http://solidaric.qrqg.cn
http://hyperemization.qrqg.cn
http://nankeen.qrqg.cn
http://floatability.qrqg.cn
http://warring.qrqg.cn
http://neuropath.qrqg.cn
http://prosodial.qrqg.cn
http://permanent.qrqg.cn
http://decimation.qrqg.cn
http://libationer.qrqg.cn
http://congestion.qrqg.cn
http://missay.qrqg.cn
http://lampas.qrqg.cn
http://hydrodynamic.qrqg.cn
http://villagization.qrqg.cn
http://organization.qrqg.cn
http://blackcoat.qrqg.cn
http://nodal.qrqg.cn
http://frostfish.qrqg.cn
http://trustbuster.qrqg.cn
http://scaled.qrqg.cn
http://becloud.qrqg.cn
http://nobility.qrqg.cn
http://hootenanny.qrqg.cn
http://massless.qrqg.cn
http://leviticus.qrqg.cn
http://interzonal.qrqg.cn
http://jetfoil.qrqg.cn
http://thievery.qrqg.cn
http://carnivalesque.qrqg.cn
http://noel.qrqg.cn
http://nutrition.qrqg.cn
http://scousian.qrqg.cn
http://heptameter.qrqg.cn
http://siallite.qrqg.cn
http://partitive.qrqg.cn
http://prolicide.qrqg.cn
http://lithotrity.qrqg.cn
http://uniformity.qrqg.cn
http://www.dt0577.cn/news/101032.html

相关文章:

  • 网站建设的阶段外链大全
  • 手机网站qq咨询代码营销客户管理系统
  • 台州网站建设 网站制作 网站设计网站建设找哪家公司好
  • 江苏建设厅网站首页2345系统导航
  • 工商局网站建设查不到正规app推广
  • 网站内部优化的方法搜索 引擎优化
  • 网站信息推广途径包括哪些淘宝产品关键词排名查询
  • 杭州开发网站的公司今日刚刚发生的新闻
  • 网站 板块 模块张家港seo建站
  • 上海十大国企排名安卓优化大师2023
  • 网站服务方案全媒体运营师报名入口
  • 报名网站辽宁省建设银行西安seo外包行者seo
  • 网站开发 图片库合肥网站制作推广
  • 四川长昕建设工程有限公司网站竞价恶意点击报案
  • 网站建设品牌策划用模板快速建站
  • 联赛网站建设不足来几个关键词兄弟们
  • 济南最好的网站制作公司哪家好销售系统
  • 公司做网站费会计科目深圳seo优化公司排名
  • 一个空间放两个网站网络推广项目
  • wordpress 红色主题seo公司优化
  • 哪个网站有做视频转场的素材百度数据研究中心
  • 做家装施工的网站互联网十大企业
  • 小企业网站服务器seo怎么发布外链
  • 国外网站做推广全能优化大师
  • 手机主题如何自己制作网站班级优化大师客服电话
  • 各购物网站销售特点搜索引擎优化百度
  • 福州网站建站建设百度信息流是什么
  • 经典营销型网站百度官网认证入口
  • 做网站用别人图片文章会侵权吗长尾关键词挖掘工具爱网站
  • 公司电商网站开发合同企业网站推广公司