package com.testshipboat;
import xieyan.ControlInterface;
import xieyan.DataInterface;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import com.data.Data;
public class MainScreen extends Activity implements OnClickListener{
private ImageButton bt;
private Button easy_mode;
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_screen);
context = MainScreen.this;
bt = (ImageButton)findViewById(R.id.game_start);
easy_mode = (Button)findViewById(R.id.easy_mode);
easy_mode.setVisibility(View.INVISIBLE);
bt.setOnClickListener(this);
}
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
switch(arg0.getId()){
case R.id.game_start:
//进入游戏
Data.currentStage = 1;
DataInterface dataIn = new DataInterface();
//三条生命
dataIn.setLife(3);
dataIn.setScore(0);
Intent it = new Intent();
it.setClass(context, TestShip.class);
startActivity(it);
break;
}
}
}
|
|