简单游戏制作——飞行棋

控制台初始化

int w = 50;
int h = 50;
ConsoleInit(w, h);
static void ConsoleInit(int w, int h)
{
    //基础设置
    //光标的隐藏
    Console.CursorVisible = false;
    //舞台的大小
    Console.SetWindowSize(w, h);
    Console.SetBufferSize(w, h);
}

场景选择相关

#region 场景选择相关
//声明一个表示场景标识的变量
E_SceneType nowSceneType = E_SceneType.Begin;
while (true)
{
    switch (nowSceneType)
    {
        case E_SceneType.Begin:
            //开始场景逻辑
            Console.Clear();
            break;
        case E_SceneType.Game:
            //游戏场景逻辑
            Console.Clear();
            break;
        case E_SceneType.End:
            //结束场景逻辑
            Console.Clear();
            break;
        default:
            break;
    }
}
#endregion
/// <summary>
/// 游戏场景枚举类型
/// </summary>
enum E_SceneType
{
    /// <summary>
    /// 开始场景
    /// </summary>
    Begin,
    /// <summary>
    /// 游戏场景
    /// </summary>
    Game,
    /// <summary>
    /// 结束场景
    /// </summary>
    End
}

开始场景逻辑实现

static void GameScene(int w, int h, ref E_SceneType nowSceneType)
{
    Console.SetCursorPosition(w / 2 - 3, 8);
    Console.Write("飞行棋");
    //当前选项的编号
    int nowSelIndex = 0;

    bool isQuitBengin = false;

    //开始场景逻辑处理函数
    while (true)
    {
        Console.SetCursorPosition(w / 2 - 4, 13);
        Console.ForegroundColor = nowSelIndex == 0 ? ConsoleColor.Red : ConsoleColor.White;
        Console.Write("开始游戏");

        Console.SetCursorPosition(w / 2 - 4, 15);
        Console.ForegroundColor = nowSelIndex == 1 ? ConsoleColor.Red : ConsoleColor.White;
        Console.Write("退出游戏");

        //通过ReadKey可以得到一个输入的枚举类型
        switch (Console.ReadKey(true).Key)
        {
            case ConsoleKey.W:
                --nowSelIndex;
                if (nowSelIndex < 0)
                {
                    nowSelIndex = 0;
                }
                break;
            case ConsoleKey.S:
                ++nowSelIndex;
                if (nowSelIndex > 1)
                {
                    nowSelIndex = 1;
                }
                break;
            case ConsoleKey.J:
                if (nowSelIndex == 0)
                {
                    //进入游戏场景
                    //1.改变当前场景的ID
                    nowSceneType = E_SceneType.Game;
                    //退出当前循环
                    isQuitBengin = true;
                }
                else
                {
                    //退出游戏
                    Environment.Exit(0);
                }
                break;
        }
        //通过标识决定是否跳出开始场景的循环
        if (isQuitBengin)
        {
            break;
        }
    }
}

游戏场景逻辑实现

不变的红墙

static void DrawWall(int w, int h)
{
    Console.ForegroundColor = ConsoleColor.Red;
    //画墙
    //横着的墙
    for (int i = 0; i < w; i += 2)
    {
        //最上方的墙
        Console.SetCursorPosition(i, 0);
        Console.Write("■");
        //最下面的墙
        Console.SetCursorPosition(i, h - 1);
        Console.Write('■');

        //中间的墙
        Console.SetCursorPosition(i, h - 6);
        Console.Write('■');
        Console.SetCursorPosition(i, h - 11);
        Console.Write('■');
    }
    //竖着的墙
    for (int i = 0; i < h; i++)
    {
        //最左边
        Console.SetCursorPosition(0, i);
        Console.Write('■');

        Console.SetCursorPosition(w - 2, i);
        Console.Write('■');
    }
    //文字信息
    Console.ForegroundColor = ConsoleColor.White;
    Console.SetCursorPosition(2, h - 10);
    Console.Write("□:普通格子");

    Console.ForegroundColor = ConsoleColor.Blue;
    Console.SetCursorPosition(2, h - 9);
    Console.Write("‖:暂停,一回合不动");

    Console.ForegroundColor = ConsoleColor.Red;
    Console.SetCursorPosition(26, h - 9);
    Console.Write("●:炸弹,倒退5格");

    Console.ForegroundColor = ConsoleColor.Yellow;
    Console.SetCursorPosition(2, h - 8);
    Console.Write("¤:时空隧道,随机倒退,暂停,换位置");

    Console.ForegroundColor = ConsoleColor.Cyan;
    Console.SetCursorPosition(2, h - 7);
    Console.Write("★:玩家");

    Console.ForegroundColor = ConsoleColor.Magenta;
    Console.SetCursorPosition(12, h - 7);
    Console.Write("▲:电脑");

    Console.ForegroundColor = ConsoleColor.DarkGreen;
    Console.SetCursorPosition(22, h - 7);
    Console.Write("◎:玩家和电脑重合");

    Console.ForegroundColor = ConsoleColor.White;
    Console.SetCursorPosition(2, h - 5);
    Console.Write("按任意键开始扔色子");
}

格子结构体和格子枚举

/// <summary>
/// 格子类型枚举
/// </summary>
enum E_Grid_type
{
    /// <summary>
    /// 普通格子
    /// </summary>
    Normal,
    /// <summary>
    /// 炸弹
    /// </summary>
    Boom,
    /// <summary>
    /// 暂停
    /// </summary>
    Pause,
    /// <summary>
    /// 时空隧道,随机倒退,暂停,换位置
    /// </summary>
    Tunnel,
}

struct Vector2
{
    public int x;
    public int y;

    public Vector2(int x, int y)
    {
        this.x = x;
        this.y = y;
    }
}

struct Grid
{
    //格子的类型
    E_Grid_type type;
    //格子的位置
    public Vector2 pos;

    //初始化构造函数
    public Grid(int x, int y, E_Grid_type type)
    {
        pos.x = x;
        pos.y = y;
        this.type = type;
    }

    public void Draw()
    {
        //提出来的目的,就是少写几行代码,因为它们不管哪种类型,都要设置了位置再画
        Console.SetCursorPosition(pos.x, pos.y);
        switch (type)
        {
            //普通格子怎么画
            case E_Grid_type.Normal:
                Console.ForegroundColor = ConsoleColor.White;
                Console.Write("□");
                break;
            //炸弹怎么画
            case E_Grid_type.Boom:
                Console.ForegroundColor = ConsoleColor.Red;
                Console.Write("●");
                break;
            //暂停怎么画
            case E_Grid_type.Pause:
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.Write("‖");
                break;
            //时空隧道怎么画
            case E_Grid_type.Tunnel:
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.Write("¤");
                break;
        }
    }
}

地图结构体

struct Map
{
    public Grid[] grids;

    //初始化中初始了各个格子类型和位置
    public Map(int x, int y, int num)
    {
        grids = new Grid[num];

        //用于位置变化计数的变量
        //表示X变化的次数
        int indexX = 0;
        //表示Y变化的次数
        int indexY = 0;
        //x的步长
        int stepNum = 2;

        Random r = new Random();
        int randomNum;
        for (int i = 0; i < num; i++)
        {
            //应该初始化格子类型
            randomNum = r.Next(0, 101);

            //设置类型,普通格子
            //有85%几率是普通格子(首尾两个格子,必为普通格子)
            if (randomNum < 85 || i == 0 || i == num - 1)
            {
                grids[i].type = E_Grid_type.Normal;
            }
            //有5%的几率是炸弹
            else if (randomNum >= 85 && randomNum < 90)
            {
                grids[i].type = E_Grid_type.Boom;
            }
            //有5%的几率是暂停
            else if (randomNum >= 90 && randomNum < 95)
            {
                grids[i].type = E_Grid_type.Pause;
            }
            //有5%的几率是时空隧道
            else
            {
                grids[i].type = E_Grid_type.Tunnel;
            }
            //位置应该如何设置
            grids[i].pos = new Vector2(x, y);
            //每次循环都应该按一定规则去变化位置

            //加十次
            if (indexX == 10)
            {
                y += 1;
                //加一次Y记一次数
                ++indexY;
                if (indexY == 2)
                {
                    //y加了2次过后,把x加的次数记0
                    indexX = 0;
                    indexY = 0;
                    //反向步长
                    stepNum = -stepNum;
                }
            }
            else
            {
                x += stepNum;
                //加一次x记一次数
                ++indexX;
            }
        }
    }

    public void Draw()
    {
        for (int i = 0; i < grids.Length; i++)
        {
            grids[i].Draw();
        }
    }
}

玩家枚举和玩家结构体

/// <summary>
/// 玩家枚举类型
/// </summary>
enum E_PlayType
{
    /// <summary>
    /// 玩家
    /// </summary>
    Player,
    /// <summary>
    /// 电脑
    /// </summary>
    Computer,
}

struct Player
{
    //玩家类型
    public E_PlayType type;
    //当前所在地图哪一个索引的格子
    public int nowIndex;

    public Player(int index, E_PlayType type)
    {
        nowIndex = index;
        this.type = type;
    }

    public void Draw(Map mapInfo)
    {
        //必需要先得到地图才能够得到玩家在地图上的哪一个格子
        //从传入的地图中得到格子信息
        Grid grid = mapInfo.grids[nowIndex];
        //设置位置
        Console.SetCursorPosition(grid.pos.x, grid.pos.y);
        //画,设置颜色,设置图标
        switch (type)
        {
            case E_PlayType.Player:
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("★");
                break;
            case E_PlayType.Computer:
                Console.ForegroundColor = ConsoleColor.Magenta;
                Console.Write("▲");
                break;
            default:
                break;
        }
    }
}
static void DrawPlayer(Player player, Player computer, Map map)
{
    //重合时
    if (player.nowIndex == computer.nowIndex)
    {
        //得到重合的位置
        Grid grid = map.grids[player.nowIndex];
        Console.SetCursorPosition(grid.pos.x, grid.pos.y);
        Console.ForegroundColor = ConsoleColor.DarkGreen;
        Console.Write("◎");
    }
    //不重合的时候
    else
    {
        player.Draw(map);
        computer.Draw(map);
    }
}

扔色子逻辑

//擦除提示的函数
static void ClearInfo(int h)
{
    Console.SetCursorPosition(2, h - 5);
    Console.Write("                                      ");
    Console.SetCursorPosition(2, h - 4);
    Console.Write("                                      ");
    Console.SetCursorPosition(2, h - 3);
    Console.Write("                                      ");
    Console.SetCursorPosition(2, h - 2);
    Console.Write("                                      ");
}

///<summary>
///扔色子函数
///</summary>
///<param name="w">窗口的宽</param>
///<param name="h">窗口的高</param>
///<param name="p">扔色子的对象</param>
///<param name="map">地图信息</param>
///<returns>默认返回false,代表没有结束</returns>
static bool RandomMove(int w, int h, ref Player p, ref Player otherp, Map map)
{
    //擦除之前显示的信息
    ClearInfo(h);
    //根据扔色子的玩家类型,决定信息的颜色
    Console.ForegroundColor = p.type == E_PlayType.Player ? ConsoleColor.Cyan : ConsoleColor.Magenta;

    //扔色子之前判断玩家是否处于暂停状态
    if (p.isPause)
    {
        Console.SetCursorPosition(2, h - 5);
        Console.Write("处于暂停点,{0}需要暂停一回合", p.type == E_PlayType.Player ? "你" : "电脑");
        Console.SetCursorPosition(2, h - 4);
        Console.Write("请按任意键,让{0}开始扔色子", p.type == E_PlayType.Player ? "电脑" : "你");
        //停止暂停
        p.isPause = false;
        return false;
    }

    //扔色子的目的是改变玩家或者电脑的位置,计算位置的变化
    //默认没有结束
    //扔色子,随机一个1到6的数加上去
    Random r = new Random();
    int randomNum = r.Next(1, 7);
    p.nowIndex += randomNum;

    //打印扔的点数
    Console.SetCursorPosition(2, h - 5);
    Console.Write("{0}扔出的点数为:{1}", p.type == E_PlayType.Player ? "你" : "电脑"
        , randomNum);

    //首先判断是否到终点了
    if (p.nowIndex >= map.grids.Length - 1)
    {
        p.nowIndex = map.grids.Length - 1;
        Console.SetCursorPosition(2, h - 4);
        if (p.type == E_PlayType.Player)
        {
            Console.Write("恭喜你,你率先到达了终点");
        }
        else
        {
            Console.Write("很遗憾,电脑率先到达了终点");
        }

        Console.SetCursorPosition(2, h - 3);
        Console.Write("请按任意键结束游戏");
        return true;
    }
    else
    {
        //没有到达终点就判断当前对象倒了一个什么样的格子
        Grid grid = map.grids[p.nowIndex];

        switch (grid.type)
        {
            case E_Grid_type.Normal:
                //普通格子不用处理
                Console.SetCursorPosition(2, h - 4);
                Console.Write("{0}到了一个安全的位置", p.type == E_PlayType.Player ?
                    "你" : "电脑");
                Console.SetCursorPosition(2, h - 3);
                Console.Write("请按任意键,让{0}开始扔色子", p.type == E_PlayType.Player ? "你" : "电脑");
                break;
            case E_Grid_type.Boom:
                //炸弹退格
                p.nowIndex -= 5;
                //不能比起点还小
                if (p.nowIndex < 0)
                {
                    p.nowIndex = 0;
                }
                Console.SetCursorPosition(2, h - 4);
                Console.Write("{0}踩到了炸弹,后退5格", p.type == E_PlayType.Player ?
                    "你" : "电脑");
                Console.SetCursorPosition(2, h - 3);
                Console.Write("请按任意键,让{0}开始扔色子", p.type == E_PlayType.Player ? "你" : "电脑");
                break;
            case E_Grid_type.Pause:
                //暂停一回合
                //暂停目的,只有加一个对象的暂停标识,才能知道下一回合它是不是不能扔色子
                p.isPause = true;
                Console.SetCursorPosition(2, h - 4);
                Console.Write("{0}踩到了炸弹,退后5格", p.type == E_PlayType.Player ?
                    "你" : "电脑");
                Console.SetCursorPosition(2, h - 3);
                Console.Write("请按任意键,让{0}开始扔色子", p.type == E_PlayType.Player ? "你" : "电脑");
                break;
            case E_Grid_type.Tunnel:
                Console.SetCursorPosition(2, h - 4);
                Console.Write("{0}踩到了时空隧道", p.type == E_PlayType.Player ?
                    "你" : "电脑");
                Console.SetCursorPosition(2, h - 3);
                Console.Write("请按任意键,让{0}开始扔色子", p.type == E_PlayType.Player ? "你" : "电脑");
                //随机
                randomNum = r.Next(1, 91);
                //触发倒退
                if (randomNum <= 30)
                {
                    p.nowIndex -= 5;
                    if (p.nowIndex < 0)
                    {
                        p.nowIndex = 0;
                    }
                    Console.SetCursorPosition(2, h - 3);
                    Console.Write("触发倒退5格");
                }
                //触发暂停
                else if (randomNum <= 60)
                {
                    p.isPause = true;
                    Console.SetCursorPosition(2, h - 3);
                    Console.Write("触发暂停一回合");
                }
                //触发交换位置
                else
                {
                    int temp = p.nowIndex;
                    p.nowIndex = otherp.nowIndex;
                    otherp.nowIndex = temp;
                    Console.SetCursorPosition(2, h - 3);
                    Console.Write("惊喜,惊喜,双方交换位置");
                }
                break;
            default:
                break;
        }
    }

    //默认没有结束
    return false;

}

结束场景逻辑实现

static void BeginOrEndScene(int w, int h, ref E_SceneType nowSceneType)
{
    Console.ForegroundColor = ConsoleColor.White;
    Console.SetCursorPosition(nowSceneType == E_SceneType.Begin ? w / 2 - 3 : w / 2 - 4, 8);
    Console.Write(nowSceneType == E_SceneType.Begin ? "飞行棋" : "游戏结束");
    //当前选项的编号
    int nowSelIndex = 0;

    bool isQuitBengin = false;

    //开始场景逻辑处理函数
    while (true)
    {
        Console.SetCursorPosition(nowSceneType == E_SceneType.Begin ? w / 2 - 4 : w / 2 - 5, 13);
        Console.ForegroundColor = nowSelIndex == 0 ? ConsoleColor.Red : ConsoleColor.White;
        Console.Write(nowSceneType == E_SceneType.Begin ? "开始游戏" : "回到主菜单");

        Console.SetCursorPosition(w / 2 - 4, 15);
        Console.ForegroundColor = nowSelIndex == 1 ? ConsoleColor.Red : ConsoleColor.White;
        Console.Write("退出游戏");

        //通过ReadKey可以得到一个输入的枚举类型
        switch (Console.ReadKey(true).Key)
        {
            case ConsoleKey.W:
                --nowSelIndex;
                if (nowSelIndex < 0)
                {
                    nowSelIndex = 0;
                }
                break;
            case ConsoleKey.S:
                ++nowSelIndex;
                if (nowSelIndex > 1)
                {
                    nowSelIndex = 1;
                }
                break;
            case ConsoleKey.J:
                if (nowSelIndex == 0)
                {
                    //进入游戏场景
                    //1.改变当前场景的ID
                    nowSceneType = nowSceneType == E_SceneType.Begin ? E_SceneType.Game : E_SceneType.Begin;
                    //退出当前循环
                    isQuitBengin = true;
                }
                else
                {
                    //退出游戏
                    Environment.Exit(0);
                }
                break;
        }
        //通过标识决定是否跳出开始场景的循环
        if (isQuitBengin)
        {
            break;
        }
    }
}

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

30 天 52% 回报:GPT-4o 量化交易机器人

本文介绍了如何利用GPT-4o&#xff0c;结合量化交易技术创建盈利的交易机器人策略&#xff0c;并通过回溯测试验证这一策略的有效性。原文: 52% Returns in 30 Days: Your GPT-4o Quant Trading Bot Strategy 量化交易可以盈利&#xff0c;但只有拥有丰富资源、拥有编码和数学技…

解决 Vue-Element-admin 后台请求Uncaught (in promise) Object

文章目录 问题描述原因分析解决方案 问题描述 前端Vue-Element-admin与SpringBoot后端对接login接口后&#xff0c;后端login接口正常响应&#xff0c;但在前台无法登入系统&#xff0c;浏览器控制台报了 Uncaught (in promise) Object 错误。 报错详情如下所示&#xff1a;…

不一样的SYSTEM APP(SYSTEM flag和system_prop区别)

1.问题引入 在Android开发中, 1)Framework中PackageManager扫包后,会把app归类为SYSTEM, SYSTEM_EXT, PRIVILEGED 类别. 2)同样的, SeAndroid也会把APP归类程platform_app, system_app, untrusted_app(甚至还有其他,mediaprovider,gmscore_app). flag SYSTEM和system_app我们…

Linux中的yum和vim

Linux软件包管理 一.什么是软件包二.如何查看软件包二.如何安装软件三.vim编辑器3.1在vim编辑器中有三种模式&#xff0c;即命令模式插入模式低行模式 3.2vim的基本操作3.3vim末行模式命令集 一.什么是软件包 有些人把一些常用的软件提前编译好, 做成软件包(可以理解成windows上…

Android 自定义View

我们所有的试图都是起源于自定义View&#xff0c;包括ViewGroup也是继承于它&#xff0c;可以说它是视图组件之父。 我们可以从它的大致流程来分为四个部分&#xff1a; 构造方法&#xff0c;onMeasure&#xff0c;onLayout&#xff0c;onDraw 构造方法&#xff1a; 它主要有…

14 学习PID--步进电机梯形加减速实现原理

步进电机加减速使用的场景有那些呢&#xff1f;为什么要使用加减速呢&#xff1f; 硬件驱动细分器与软件的细分参数或定时器分频参数设置不当时启动电机时&#xff0c;会遇见步进电机有啸叫声但是不会转动&#xff0c;这是因为软件产生脉冲的频率大于步进电机的启动频率&#x…

大数据入门实践一:mac安装Hadoop,Hbase,FLume

一、安装Hadoop 安装hadoop参考此文&#xff0c;关键点是安装JDK和Hadoop的配置&#xff0c;为避免引用文章变收费&#xff0c;我把关键信息摘录如下&#xff1a; jdk安装和配置就不说了(我本机安装了1.8/15/17/21&#xff0c;以17为主&#xff09;&#xff0c;hadoop安装过程…

2024/6/16周报

文章目录 摘要Abstract文献阅读题目问题本文贡献方法aGNN输入和输出模块嵌入模块编码器和解码器模块&#xff1a;支持多头注意的GCN多头自注意力机制GCN模型解释&#xff1a;SHAP 案例研究地下水流动与污染物运移模型研究场景设计 数据集实验结果 代码复现结论 摘要 本周阅读了…

Java项目之消息队列(手写java模拟实现mq)【七、⽹络通信协议设计、消息队列服务器端实现、客户端实现】✔ ★

⼗⼀. ⽹络通信协议设计 定义 Request / Response /** 表示一个网络通信中的请求对象. 按照自定义协议的格式来展开的*/ public class Request {private int type;private int length;private byte[] payload;public int getType() {return type;}public void setType(int typ…

AI探索:最佳落地应用场景

如果说今年的风口&#xff0c;那一定是 AI。不过AI像一把双刃剑&#xff0c;既有助益也有风险。我们将从IBM Watson的高飞与坠落&#xff0c;到Google Allo的黯然失色&#xff0c;探索AI应用中的教训。同时&#xff0c;瑞幸咖啡的成功故事展现了凭借策略得当的AI应用&#xff0…

PTA 6 - 20 汉诺塔问题(py 递归)

这道题是一道比较典型的递归问题&#xff0c;他跟斐波那契数列的本质是一样的&#xff0c;大家自己动手推理一下&#xff0c;非常好推 参考代码&#xff1a; def hanoi(n,a,b,c):global stepif n 1:print(a,"->",c)step 1else:hanoi(n-1,a,c,b)print(a,"…

msvcp120.dll丢失原因分析与解决方法分享

msvcp120.dll 是一个动态链接库&#xff08;Dynamic Link Library, DLL&#xff09;&#xff0c;属于 Microsoft Visual C 2013 再发行组件包的一部分。它提供了 C 标准库的实现&#xff0c;使得使用 C 编写的应用程序能够在运行时动态链接到该库&#xff0c;从而访问其提供的函…

【云岚到家】-day03-1-门户等缓存方案选择

【云岚到家】-day03-1-门户-缓存方案选择 1 门户1.1 门户简介1.2 常见的技术方案1.2.1 需求1.2.2 常见门户1.2.2.1 Web门户1.2.2.2 移动应用门户1.2.2.3 总结 2 缓存技术方案2.1 需求分析2.1.1 界面原型2.2.2 缓存需求 3 SpringCache入门3.1 基础概念3.1.1 Redis客户端3.1.2 Sp…

ping: www.baidu.com: 未知的名称或服务(IP号不匹配)

我用的是VMware上的Red Hat Enterprise Linux 9&#xff0c;出现了能联网但ping不通外网的情况。 问题描述&#xff1a;设置中显示正常连接&#xff0c;而且虚拟机右上角有联网的图标&#xff0c;但不能通外网。 按照网上教程修改了/etc/resolv.conf和/etc/sysconfig/network-…

Shell 学习笔记 - 导读 + 变量定义

初识 Shell 本章学习目标 了解什么是 Shell了解 Shell 的版本及用途掌握 Shell 变量的用法 导读&#xff08; 了解 \color{cyan}{了解} 了解&#xff09; 现在的人们使用的操作系统&#xff08;Windows、Android、iOS 等&#xff09;都带有图形化界面&#xff0c;简单直观&…

Folx软件安装教程及最新版下载

简介&#xff1a; Folx Pro是一款适合Mac的专业下载工具也是一款BT下载器&#xff0c;Folx中文版有一个支持Retina显示的现代界面&#xff0c;提供独特的系统排序、存储下载内容与预览下载文件。Folx中文官网提供Folx教程、激活码、下载。 安 装 包 获 取 地 址&#xff1a; …

Pytest框架中fixture功能详解

文章目录 1 定义 Fixture函数 2 Fixture 的函数参数 2.1 传入其他fixture函数作为参数 2.2 传入request对象参数 示例1&#xff1a;访问fixture的调用者 示例2&#xff1a;使用fixture的参数 3 Fixture 的作用域参数scope 3.1 scopeclass场景 3.2 scopesession场景 4…

Vue52-scoped样式

一、scoped样式的作用 1-1、scoped样式的作用 vue中组件的样式都是汇总到一起的。容易出现一个问题&#xff1a;类名冲突。 示例&#xff1a; school和student组件的类名都叫demo&#xff0c;则student的样式将覆盖school的样式&#xff0c;因为App.vue中&#xff0c;先引入的…

光明网发稿投稿流程与要求,光明日报如何投稿?附光明网多少钱(价格表)

对于想要在光明网发稿的作者来说&#xff0c;媒介多多网发稿平台是一个绝佳的投稿选择。光明网作为国内一流的新闻媒体平台&#xff0c;其严谨的文章审核标准和广泛的读者基础吸引着无数作者。然而&#xff0c;由于其严格的发稿标准&#xff0c;一些作者可能会遇到一些困难&…

昂科烧录器支持Prolific旺玖科技的电力监控芯片PL7413C1FIG

芯片烧录行业领导者-昂科技术近日发布最新的烧录软件更新及新增支持的芯片型号列表&#xff0c;其中Prolific旺玖科技的高度集成的电力监控芯片PL7413C1FIG已经被昂科的通用烧录平台AP8000所支持。 PL7413C1FIG是一款高度集成的电力监控芯片&#xff0c;用于测量电力使用情况的…