0
点赞
收藏
分享

微信扫一扫

c++超级简单的小游戏(下)

cnlinkchina 2022-04-16 阅读 86
c++

来,我们接着搞双人对战

我也懒得写了

稍微改一下就好了

//头文件懒得写了自行脑补吧
int main(){
    int myblood = 100;//我的血量
    int hisblood = 100;//敌人的血量
    cout << hisblood<< "      "<< myblood;//加上我的血量
    int mygj;//技能
    int yourgj;//对手技能
    if(mygj == 1){//一技能
        hisblood - 10;
        myblood - 10;
        system("cls");//清屏
        cout << hisblood<< "      ";
        Sleep(500);//等待半秒
        cout << myblood;
    }//多个技能可以用switch
    if(yourgj == ###){
//懒得写
        &****&
}//多个技能可以用switch
    return 0;
}

还可以加一个判断先手的

int xianshou;
if(xianshou == 1){
......
}else{
......
}

完结

举报

相关推荐

0 条评论