-1
플레이어가 게임의 필수 점수를 얻으면 다음 단계로가는 방법에 대해 알고 싶습니다.플레이어가 필요한 점수를 얻었을 때 다음 단계로 이동하는 방법
예를 들어 필요한 점수는 100입니다. 점수에 도달하면 그는 다음 단계로 진행합니다. 이 코드를 시작하는 방법을 모릅니다. 아이디어를 좀주세요.
플레이어의 점수를 표시하는 코드입니다. 플레이어가 100이되면, 다음 단계로 잠금을 해제하면 재생할 수 있습니다.
// score
Paint paint = new Paint();
paint.setColor(Color.BLUE);
paint.setAntiAlias(true);
paint.setFakeBoldText(true);
paint.setTextSize(15);
paint.setTextAlign(Align.LEFT);
canvas.drawText("Score :" + score, 3 * sx/4, 20, paint);
// exit
canvas.drawBitmap(exit, 0, 0, null);
if (sound == 1) {
mp1.start();
mp1.setLooping(true);
}
이
내 LevelForm의 코드public class LvlForm1 extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lvl_form1);
}
public void action(View v){
int id = v.getId();
if (id==R.id.btnluneta1){
Intent intent= new Intent(this,NewGame1.class);
startActivity(intent);
}
if (id==R.id.btnvigan1){
Intent intent= new Intent(this,NewGame2.class);
startActivity(intent);
}
if (id==R.id.btnleyte1){
Intent intent= new Intent(this,NewGame3.class);
startActivity(intent);
}
if (id==R.id.btnpaoay1){
Intent intent= new Intent(this,NewGame4.class);
startActivity(intent);
}
if (id==R.id.btnbataan1){
Intent intent= new Intent(this,NewGame5.class);
startActivity(intent);
}
if (id==R.id.btnback5){
Intent intent= new Intent(this,NormalMode.class);
startActivity(intent);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.lvl_form1, menu);
return true;
}
}
내 게임 코드를 게시해야합니까? –
네, 질문에 대한 정확한 답변을 얻으려면 관련 부분을 게시하고 정확히 어떻게하려고하는지 설명하십시오. –