最近搜索

第20讲 添加游戏结束界面

浏览:467
管理员 2021-08-23 08:40

添加game_over_node节点 复制暂停节点,删除继续游戏按钮

image.png



在game里面声明这个资源

image.png




战机死了,运行,game。game_over

die(){
        this.isDie= true;
        game.game_state = 4 ;//游戏结束 
        game.isBgMove = false;
        var anim = this.getComponent(cc.Animation);
        anim.play("hero_die_animation_clip");
        anim.over = function () {
            //game.on_enemy_killed(this.node, 1);
            this.node.active = false;
            game.game_over();
        }.bind(this);
    }
    
    
    
   game_over(){
        this.game_over_node.active = true;
    },



调整界面的优先级,防止敌机在他上面

image.png

image.png

联系站长

站长微信:xiaomao0055

站长QQ:14496453