无法在Android上停止渲染

时间:2012-10-10 07:40:23

标签: android android-intent opengl-es

我希望在角色死亡后停止游戏,然后从游戏切换到屏幕上的游戏。但我发现我发现启动活动无法识别的问题

   if(!player1.isDestroyed){
        scrollBackground1(gl);
        scrollBackground2(gl);
        movePlayer1(gl); 
        moveEnemy(gl);
        detectCollisions(gl);
    }
    else{//to the gameover screen
        Intent end = new Intent(SFEngine.context, GameOver.class);
        startActivity(end);
    }

此代码来自渲染器,该类是实现渲染器,而不是活动

1 个答案:

答案 0 :(得分:0)

Intent end = new Intent(getApplicationContext(), GameOver.class);
        startActivity(end);
相关问题