Cocos creator实现飞机大战空中大战《战击长空》小游戏资源及代码

news2025/2/12 11:48:37

Cocos creator实现飞机大战空中大战《战击长空》小游戏资源及代码
最近在学习Cocos Creator,作为新手,刚刚开始学习Cocos Creator,刚刚入门,这里记录一下飞机大战小游戏实现。

在这里插入图片描述
在这里插入图片描述

https://wxaurl.cn/VEgRy2eTMyi

一 安装CocosDashBoard

这里就不介绍如何安装了

二 新建2D项目FlyWar

2.1、管理项目目录
在资源管理器中新建文件夹

anim 动画
preb 预制体
res 图片、语音资源
scene 场景
scripts 脚本资源
将资源文件拖到res目录下

在这里插入图片描述

三、关键步骤

3.1 实现背景的移动代码

背景的星空会有移动的效果

import GameConstant from "./GameConstant";

const {ccclass, property} = cc._decorator;

@ccclass
export default class MoveBackground extends cc.Component {    
    bgs : cc.Node[];

    @property
    speed : number = 50;

    canvasWidth: number;
    canvasHeight: number;

    onLoad () {
        let canvas = cc.find('Canvas');
        this.canvasWidth = canvas.width;
        this.canvasHeight = canvas.height;
    
        // 注册特定事件
        cc.director.on(GameConstant.kUpdateGameStatus, this.listenGameStatus, this);
    }

    listenGameStatus() {
        
    }

    start () {
        this.node.width= this.canvasWidth;
        this.node.height = this.canvasHeight;

        this.bgs = this.node.children;
        for (let index = 0; index < this.bgs.length; index++) {
            let element = this.bgs[index];
            element.width = this.canvasWidth;
            element.height = this.canvasHeight;
        }

        // 设置默认
        if (this.bgs.length >= 2) {
            this.bgs[1].y = this.bgs[0].y + this.bgs[0].height; 
        }
    }

    update (dt) {
        this.bgs[0].y -= this.speed * dt;
        this.bgs[1].y -= this.speed * dt;
        if (this.bgs[0].y < -this.canvasHeight) {
            this.bgs[0].y = this.bgs[1].y + this.bgs[1].height;
        }

        if (this.bgs[1].y < -this.canvasHeight) {
            this.bgs[1].y = this.bgs[0].y + this.bgs[0].height;
        }
    }
}

3.2 实现自己飞机的绑定击碰撞检测

在这里插入图片描述

首先将load方法中开启碰撞检测

// 碰撞检测
cc.director.getCollisionManager().enabled = true;

将手指移动飞机

start() {
        // touch input
        this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchBegan, this);
        this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnded, this);
        this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.onTouchEnded, this);
        this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
    }

    // touch事件
    onTouchBegan(event) {
        if (this.isSelected == true) {
            return;
        }
        let position = event.getLocation();
        this.isSelected = true;
        this.touchStartX = position.x;
        this.touchStartY = position.y;
    }

    onTouchEnded() {
        this.isSelected = false;
    }

    onTouchMove(e: cc.Event.EventTouch) {
        let gameStatus = GameStateManager.instance().getGameStatus();
        if (this.isSelected && (GameConstant.GameStatus.BOSSBOOMFINISH != gameStatus)) {
            let position = e.getLocation();
            let moveX = position.x;
            let moveY = position.y;
            let disX = (moveX - this.touchStartX);
            let disY = (moveY - this.touchStartY);
            this.updateNodeX(disX, disY);

            this.touchStartX = position.x;
            this.touchStartY = position.y;
        }
    }

    // 更新位置
    updateNodeX(distanceX, distanceY) {
        this.playerRoot.x += distanceX;
        if (this.playerRoot.x < -this.canvasWidth / 2) {
            this.playerRoot.x = -this.canvasWidth / 2;
        }

        if (this.playerRoot.x > this.canvasWidth / 2) {
            this.playerRoot.x = this.canvasWidth / 2;
        }

        this.playerRoot.y += distanceY;
        if (this.playerRoot.y < -this.canvasHeight / 2) {
            this.playerRoot.y = -this.canvasHeight / 2;
        }

        if (this.playerRoot.y > this.canvasHeight / 2) {
            this.playerRoot.y = this.canvasHeight / 2;
        }

        this.playerBulletRoot.x = this.playerRoot.x;
        this.playerBulletRoot.y = this.playerRoot.y + 50;
    }

玩家飞机的碰撞,当碰撞到不同的敌机就会出现血量减少的

onCollisionEnter(other, self) {
        if (this.isDead == true) {
            return;
        }
        let deltax = 0;

        if (other.tag == 999) {
            // 撞击到敌机BOSS
            // dead,游戏结束,跳转到结果页面
            this.isDead = true;
            this.showPlaneBoom();
            return;
        }

        if (other.tag == 888) {
            // 获得金币,每个金币50分
            this.updateScore();
        }

        if (other.tag == 911) {
            // 获得血量
            this.updateBlood();
        }

        if (other.tag == 100 || other.tag == 914) {
            // 默认子弹 -1
            // 减去血量
            this.bloodNumber -= 1;
            deltax = 1;
        } else if (other.tag == 101 || other.tag == 102) {
            // boss大炮弹 -5
            this.bloodNumber -= 5;
            deltax = 5;
        } else if ((other.tag == 90 || other.tag == 91)) {
            // 敌机 -2
            this.bloodNumber -= 2;
            deltax = 2;
        }

        if (this.bloodNumber <= 0) {
            // dead,游戏结束,跳转到结果页面
            this.isDead = true;
            this.showPlaneBoom();
        }

        if (this.bloodNumber < 0) {
            this.bloodNumber = 0;
        }

        this.updateBloodUI(deltax);
    }

// 血量控制参考
https://blog.csdn.net/gloryFlow/article/details/130898462

3.2 实现当前飞机发射子弹的效果

在这里插入图片描述

当前子弹发射会有角度设置,代码如下

import EnemyPlane from "./EnemyPlane";

const {ccclass, property} = cc._decorator;

// 直线的Bullet类型
@ccclass
export default class BulletLiner extends cc.Component {

    // 角度,默认90
    @property(Number)
    rotation: number = 90;

    // 速度
    @property(Number)
    speed: number = 1000;

    // 时间
    @property(Number)
    time: number = 0.0;

    // 时间点
    lifeTime: number = 2.5;
    // LIFE-CYCLE CALLBACKS:

    // 初始位置
    originPos: any;

    canvasWidth: number;
    canvasHeight: number;

    isDead: boolean = false;

    onLoad() {
        let canvas = cc.find('Canvas');
        this.canvasWidth = canvas.width;
        this.canvasHeight = canvas.height;
    }

    start () {
        this.originPos = this.node.position;
    }

    update (dt) {
        this.onMove(dt);
    }

    // 移动
    onMove(dt) {
        let distance = dt * this.speed;
        let radian = this.rotation * Math.PI / 180;

        let v2 = this.node.position; 
        let delta = cc.v2(distance * Math.cos(radian), distance * Math.sin(radian));
        v2.x += delta.x;
        v2.y += delta.y;
        this.node.position = v2;

        if (v2.y > this.canvasHeight) {
            this.node.removeFromParent();
            this.node.destroy();
        }
    }

    onCollisionEnter(other, self) {
        if ((other.tag != 110 && other.tag != 1111 && other.tag != 9911 && other.tag != 911 && other.tag != 888) && !this.isDead) {
            this.die();
        }
    }

    die() {
        this.isDead = true;
        this.node.removeFromParent();
        this.destroy();
    }
}

3.4 敌机的移动击及碰撞检测

import GameStateManager from "./GameStateManager";

const { ccclass, property } = cc._decorator;

// 敌人飞机
@ccclass
export default class EnemyPlane extends cc.Component {

    // 角度,默认90
    @property(Number)
    rotation: number = 90;

    // 速度
    @property(Number)
    speed: number = 1000;

    // 时间
    @property(Number)
    time: number = 0.0;

    // 时间点
    lifeTime: number = 2.5;
    // LIFE-CYCLE CALLBACKS:

    // 初始位置
    originPos: any;

    canvasWidth: number;
    canvasHeight: number;

    @property(cc.Prefab)
    enemyBoom: cc.Prefab = null;

    @property(cc.Prefab)
    enemyBullet: cc.Prefab = null;

    @property([cc.Prefab])
    coinPrebs: cc.Prefab[] = [];

    // 音效资源
    @property(cc.AudioClip)
    boomAudio: cc.AudioClip = null;

    isDead: boolean = false;
    isBoomAnimating: boolean = false;

    onLoad() {
        let canvas = cc.find('Canvas');
        this.canvasWidth = canvas.width;
        this.canvasHeight = canvas.height;
    }

    start() {
        this.originPos = this.node.position;
        this.enemyBulletSchedule();
    }

    update(dt) {
        this.onMove(dt);
    }

    // 移动
    onMove(dt) {
        // this.time += dt;
        // if (this.time >= this.lifeTime) {
        //     this.node.position = this.originPos;
        //     this.time = 0;
        // }

        let distance = dt * this.speed;
        let radian = this.rotation * Math.PI / 180;

        let v2 = this.node.position;
        let delta = cc.v2(distance * Math.cos(radian), distance * Math.sin(radian));
        v2.x -= delta.x;
        v2.y -= delta.y;
        this.node.position = v2;

        if (v2.y < -this.canvasHeight) {
            this.node.removeFromParent();
            this.node.destroy();
        }
    }

    // 动效效果
    showPlaneBoom() {
        if (this.isBoomAnimating) {
            return;
        }

        // 调用声音引擎播放声音
        cc.audioEngine.playEffect(this.boomAudio, false);

        this.isBoomAnimating = true;
        // 播放动画
        let boom;
        let callFunc = cc.callFunc(function () {
            this.createCoin();

            boom = cc.instantiate(this.enemyBoom);
            this.node.parent.addChild(boom);
            boom.setPosition(this.node.position);

            this.node.removeFromParent();

            let anim = boom.getComponent(cc.Animation);
            anim.play('enemy_boom');
        }, this);

        let aTime = cc.delayTime(0.1);

        let finish = cc.callFunc(function () {
            boom.removeFromParent();
            boom.destroy();
            this.isBoomAnimating = false;
            this.removeFromParent();
            this.destroy();
        }, this);

        // 创建一个缓动
        var tween = cc.tween()
            // 按顺序执行动作
            .sequence(callFunc, aTime, finish);

        cc.tween(this.node).then(tween).start();
    }

    onCollisionEnter(other, self) {
        if ((other.tag == 110 || other.tag == 1111) && !this.isDead) {
            this.die();
        }
    }

    die() {
        this.isDead = true;
        this.showPlaneBoom();
        this.updateScore();
    }

    // 更新得分
    updateScore() {
        // 每个敌机得分为10
        GameStateManager.instance().updateScore(10);
    }

    // 创建金币 每个金币10分
    createCoin() {
        let delta = 50;
        for (let index = 0; index < this.coinPrebs.length; index++) {
            let coin = cc.instantiate(this.coinPrebs[index]);
            this.node.parent.addChild(coin);
            coin.setPosition(this.node.position);
            coin.x = this.node.x + Math.random() * delta;
            coin.y = this.node.y;
        }
    }

    // 倒计时
    enemyBulletSchedule() {
        this.schedule(this.onCreateEnemyBullet, 1.5);
    }

    onCreateEnemyBullet() {
        let bullet = cc.instantiate(this.enemyBullet);
        this.node.parent.addChild(bullet);
        bullet.setPosition(this.node.position);
        bullet.x = this.node.x;
        bullet.y = this.node.y;
    }

    stopSchedule() {
        this.unschedule(this.onCreateEnemyBullet);
    }

    protected onDestroy(): void {
        this.stopSchedule();
    }
}

3.5 敌机BOSS

敌机BOSS有血量
在这里插入图片描述

当前敌机BOSS只要血量为0时候就是击败了该BOSS

// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import EnemyBossBoom from "./EnemyBossBoom";
import GameConstant from "./GameConstant";
import GameStateManager from "./GameStateManager";

const {ccclass, property} = cc._decorator;

@ccclass
export default class EnemyBossPlane extends cc.Component {

    @property(cc.Prefab)
    bloodBarPreb: cc.Prefab = null;

    // boss爆炸效果
    @property(cc.Prefab)
    bossBoomPreb: cc.Prefab = null;

    // 血量
    @property(Number)
    bloodCount: number = 100;

    @property(Number)
    bloodNumber: number = 100;

    // LIFE-CYCLE CALLBACKS:
    bloodBar: cc.ProgressBar = null;

    isDead: boolean = false;

    onLoad () {
        // 不同等级boss的血量不同
        // this.bloodNumber = 100;
        // this.bloodCount = 100;

        let blood = cc.instantiate(this.bloodBarPreb);
        blood.y = 100;
        blood.x = 0;
        this.node.addChild(blood);
        this.bloodBar = blood.getComponent(cc.ProgressBar);

        this.bloodBar.progress = 1.0;
        this.bloodBar.getComponentInChildren(cc.Label).string = ""+this.bloodNumber;
    }

    start () {
        this.bloodBar.getComponentInChildren(cc.Label).string = ""+this.bloodNumber;
    }

    update (dt) {}

    // 更新血量
    updateBloodCount(aBloodCount) {
        this.bloodNumber = aBloodCount;
        this.bloodCount = aBloodCount;
    }

    onCollisionEnter(other, self) {
        if (this.isDead == true) {
            return;
        }

        let deltax = 0;
        if (other.tag == 110) {
            // 默认子弹 -1
            // 减去血量
            this.bloodNumber -= 1;
            deltax = 1;
        } 
        if (this.bloodNumber <= 0) {
            // dead,游戏结束,跳转到结果页面
            this.isDead = true;
            this.startBossBoom();
        }

        if (this.bloodNumber < 0) {
            this.bloodNumber = 0;
        }

        this.bloodBar.getComponentInChildren(cc.Label).string = ""+this.bloodNumber;
        let progress = this.bloodNumber/this.bloodCount;

        let totalLength = this.bloodBar.totalLength;
        this.bloodBar.getComponentInChildren(cc.Label).node.x -= deltax*(totalLength/this.bloodCount);
        
        this.bloodBar.progress = progress;
    }

    // boss爆炸了
    startBossBoom() {
        GameStateManager.instance().updateGameStatus(GameConstant.GameStatus.BOSSDISMISSING);
        let bossBoom = cc.instantiate(this.bossBoomPreb);
        bossBoom.y = 0;
        bossBoom.x = 0;
        this.node.addChild(bossBoom);

        bossBoom.getComponent(EnemyBossBoom).setBossBoomFinished(()=>{
            this.updateScore();
            this.bossBoomFinish();
        });
        bossBoom.getComponent(EnemyBossBoom).startPlayAnimation();
    }

    // 爆炸效果结束了
    bossBoomFinish() {
        this.node.removeAllChildren();
        this.node.removeFromParent();
        this.node.destroy();
        
        // 通知移除全部子弹、敌机飞机、暂停玩家飞机发射子弹后,
        GameStateManager.instance().updateIsWin(true);
        // 玩家飞机向上飞行后提示通关,继续创下一关
        GameStateManager.instance().updateGameStatus(GameConstant.GameStatus.BOSSBOOMFINISH);
    }

    // 更新得分
    updateScore() {
        // 每个BOSS得分为血量
        GameStateManager.instance().updateScore(this.bloodCount);
    }
}

3.6 敌机BOSS来回移动并且发射导弹

// 左右移动
    moveLeftRight() {
        // 让节点左右来回移动并一直重复
        var seq = cc.repeatForever(
            cc.sequence(
                cc.moveTo(5, cc.v2(-this.canvasWidth / 2, this.node.y)),
                cc.moveTo(5, cc.v2(this.canvasWidth / 2, this.node.y))
            ));
        this.node.runAction(seq);
    }
// 每次创建一波Boss子弹
    startCreateBossBullet() {
        var time = 0.5;
        this.schedule(this.onCreateBossBullet, time);
    }

    onCreateBossBullet() {
        var bullet = cc.instantiate(this.getBossBullet());
        this.node.parent.addChild(bullet);
        var x = this.node.x;
        var y = this.node.y - this.node.height + bullet.height;
        bullet.setPosition(cc.v2(x, y));
    }

    stopSchedule() {
        this.unschedule(this.onCreateDBullet);
        this.unschedule(this.onCreateBossBullet);
    }

    onDestroy() {
        this.stopSchedule();
    }

四、最后可以扫码看下效果。

搜索微信小游戏:战击长空

五、下载地址

https://gitee.com/baibaime/plane-war.git

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/639878.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Netty实战(十四)

WebSocket协议&#xff08;二&#xff09; 一、初始化 ChannelPipeline二、引导三、加密 一、初始化 ChannelPipeline 我们之前说过为了将 ChannelHandler 安装到 ChannelPipeline 中&#xff0c;需要扩展了ChannelInitializer&#xff0c;并实现 initChannel()方法。 下面我…

Nacos架构与原理 - 注册中心的设计原理

文章目录 Pre服务的分级模型 &#xff08;服务-集群-实例三层模型&#xff09;数据⼀致性负载均衡服务端侧负载均衡客户端侧负载均衡 健康检查性能与容量易用性集群扩展性用户扩展性 Pre 目前的网络架构是每个主机都有⼀个独立的 IP 地址&#xff0c;那么服务发现基本上都是通…

行为型设计模式07-命令模式

&#x1f9d1;‍&#x1f4bb;作者&#xff1a;猫十二懿 ❤️‍&#x1f525;账号&#xff1a;CSDN 、掘金 、个人博客 、Github &#x1f389;公众号&#xff1a;猫十二懿 命令模式 1、命令模式介绍 命令模式&#xff08;Command&#xff09;&#xff0c;将一个请求封装为一…

【Linux后端服务器开发】常用开发工具

目录 一、apt / yum 二、gcc / g 三、make / makefile 四、vi / vim 五、gdb 一、apt / yum apt 和 yum 都是在Linux环境下的软件包管理器&#xff0c;负责软件的查找、安装、更新与卸载。 apt 是Ubuntu系统的包管理器&#xff0c;yum是Centos系统的包管理器&#xff0c…

SQL回顾总结,超级全

SELECT&#xff1a;语句用于从数据库中选取数据 从 "Websites" 表中选取 "name" 和 "country" 列 SELECT name,country FROM Websites 从 "Websites" 表中选取所有列 SELECT * FROM Websites; SELECT DISTINCT&#xff1a;用于返…

Android系统视角下对APK的分析(2)- APK安装过程的定性分析

声明 以Android手机用户角度来看&#xff0c;安装各式各样的APP&#xff0c;基本就是从应用市场上 “搜索->下载->安装” 三连。而对Android系统来说&#xff0c;这就是个大工程了&#xff0c;因为对Android系统来说APK是“外来户”&#xff0c;如何安装它、有限制地支持…

linux实验三 vi编辑器及用户管理

1、vi编辑器的详细使用 &#xff08;1&#xff09;在用户主目录下建一个名为vi的目录。 &#xff08;2&#xff09;进入vi目录。 &#xff08;3&#xff09;将文件/etc/man_db.conf复制到当前目录下&#xff0c;并用命令sudo修改man_db.conf的属性为所有用户可以读写。 &am…

.net版本下载

1先登录微软 Microsoft - 云、计算机、应用和游戏 下载 .NET Framework | 免费官方下载

【Oauth2请求不带client_id,获取方法】

文章目录 前言一、关键&#xff1a;请求头 Basic xxx:xxx二、源码分析BasicAuthenticationFilter 类extractAndDecodeHeader 方法authenticate方法loadUserByUsername 方法 总结 前言 这段时间在学习 oauth2, 发现我组用的框架&#xff0c;登录请求参数中并没有 client_id &a…

JVM 面试必会面试题

1. 说一说JVM的主要组成部分 点击放大看&#xff0c;一图胜千文 jvm 方法区和堆是所有线程共享的内存区域&#xff1b;而虚拟机栈、本地方法栈和程序计数器的运行是线程私有的内存区域&#xff0c;运行时数据区域就是我们常说的JVM的内存。类加载子系统&#xff1a;根据给定的…

Altium Designer二次开发

Altium Designer二次开发就在该软件原有的基础上&#xff0c;自己写代码给它添加新功能&#xff0c;如&#xff1a;一键生成Gerber&#xff0c;计算铺铜面积&#xff0c;PCB走线的寄生参数和延时等等。 Altium Designer二次开发有两种方式&#xff0c;一种是基于Altium Designe…

Hadoop集群部署和启动与关闭

Hadoop集群的部署方式分为三种&#xff0c;分别是独立模式&#xff08;Standalone mode&#xff09;、伪分布式模式&#xff08;Pseudo-Distributed mode&#xff09;和完全分布式模式&#xff08;Cluster mode&#xff09;&#xff0c;独立模式和伪分布式模式主要用于学习和调…

Day974.授权码和访问令牌的颁发流程 -OAuth 2.0

授权码和访问令牌的颁发流程 Hi&#xff0c;我是阿昌&#xff0c;今天学习记录的是关于授权码和访问令牌的颁发流程的内容。 授权服务就是负责颁发访问令牌的服务。更进一步地讲&#xff0c;OAuth 2.0 的核心是授权服务&#xff0c;而授权服务的核心就是令牌。 为什么这么说…

被冻结的层在训练过程中参与正向反向传递,只是这一层的梯度不再更新。||底层逻辑

被冻结的层可以前向传播,也可以反向传播,只是自己这一层的参数不更新,其他未冻结层的参数正常更新。 在微调期间&#xff0c;只有被激活的层的梯度会被计算和更新&#xff0c;而被冻结的层的梯度则会保持不变。 其实从数学上去理解也不难&#xff0c;但自己手推还是需要花点时…

《自然》:DeepMind推出AlphaDev或将加速全球计算

数字世界对计算和能源的需求正在不断增加。在过去的五十年中&#xff0c;人类主要依靠硬件层面的改进来满足这一点。然而&#xff0c;随着微芯片接近其物理极限&#xff0c;改进计算机运行代码&#xff0c;以使计算算力更强大和可持续&#xff0c;变得至关重要。对于每天运行数…

线程的生命周期

我是一个线程 第一回 初生牛犊 我是一个线程&#xff0c;我一出生就被编了个号: 0x3704&#xff0c;然后被领到一个昏暗的屋子里&#xff0c;在这里我发现了很多和我一模一样的同伴。 我身边…

一文教你如何在数据库中安全地存储密码

前言 作者&#xff1a;神的孩子在歌唱 大家好&#xff0c;我叫智 让我们先谈谈什么不该做。 不要以明文形式存储密码。任何具有数据库内部访问权限的人都可以看到它们。如果数据库受损&#xff0c;攻击者可以轻松获取所有密码。那么&#xff0c;我们应该如何在数据库中安全地存…

10个ai算法常用库java版

今年ChatGPT 火了半年多,热度丝毫没有降下来。深度学习和 NLP 也重新回到了大家的视线中。有一些小伙伴问我,作为一名 Java 开发人员,如何入门人工智能,是时候拿出压箱底的私藏的学习AI的 Java 库来介绍给大家。 这些库和框架为机器学习、深度学习、自然语言处理等提供了广…

OceanBase 安全审计之身份鉴别

本文主要以 MySQL 和 OceanBase 对比的方式&#xff0c;来介绍 OceanBase&#xff08;MySQL 模式&#xff09;安全体系中关于身份鉴别的相关内容&#xff0c;包括身份鉴别机制、用户名组成、密码复杂度、密码过期策略等。 作者&#xff1a;金长龙 爱可生测试工程师&#xff0c;…

快速掌握SQL语言——数据查询语言DQL

0️⃣前言 数据查询语言DQL是一种用于查询数据库中数据的语言&#xff0c;它是SQL的一部分&#xff0c;也是SQL中最常用的语言之一。 文章目录 0️⃣前言1️⃣介绍2️⃣使用3️⃣重要性4️⃣总结 1️⃣介绍 DQL&#xff08;Data Query Language&#xff09; 主要用于从数据库中…