溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

飛翔的圓(Flappy Bird)游戲源碼完整版

發(fā)布時間:2020-06-30 10:48:03 來源:網(wǎng)絡(luò) 閱讀:538 作者:qibawangla 欄目:移動開發(fā)

這個源碼是一個不錯的休閑類的游戲源碼,飛翔的圓(Flappy Bird)游戲源碼V1.0,本項目是一個仿Flappy Bird的小游戲,只不過是把Flappy Bird里面的鳥替換成了簡單的圓。感興趣的朋友可以研究一下。本項目默認編碼GBK。

×××:http://code.662p.com/view/9013.html

public class LoadingActivity extends Activity {
     
    @Override    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState); 
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
         
        setContentView(R.layout.loading);
 
        final TextView gameStart = (TextView)findViewById(R.id.game_start);
         
        AdView adView = (AdView)findViewById(R.id.adView);
        adView.setAdListener(new AdListener() {
             
            @Override            public void onReceiveAd(Ad arg0) {
                gameStart.setVisibility(View.VISIBLE);
            }
             
            @Override            public void onPresentScreen(Ad arg0) {                // TODO Auto-generated method stub                 
            }
             
            @Override            public void onLeaveApplication(Ad arg0) {                // TODO Auto-generated method stub                 
            }
             
            @Override            public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {                // TODO Auto-generated method stub                 
            }
             
            @Override            public void onDismissScreen(Ad arg0) {                // TODO Auto-generated method stub                 
            }
        });
         
        View gameMessage = findViewById(R.id.GameMessage);         
        int[] data = getSettingData();
         
        TextView levelMessage = (TextView)findViewById(R.id.level_Message);
         
        levelMessage.setText("SCORE: "+data[0]+"\nBEST: "+data[1]);
         
        gameMessage.setOnClickListener(new View.OnClickListener() {
             
            @Override            public void onClick(View arg0) {
                 
                Intent intent = new Intent(LoadingActivity.this, GameBirdActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                 
                startActivity(intent);
                 
                finish();
            }
        });
 
    }     
    private int[] getSettingData() {
 
        SharedPreferences gb_settings = getSharedPreferences(GameBirdActivity.GameBirdSettingsFile, 0); 
        int last = gb_settings.getInt(GameBirdActivity.Settings_LevelLast, 0);        int top = gb_settings.getInt(GameBirdActivity.Settings_LevelTop, 0);         
        return new int[]{last, top};
    }
     
    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) { 
        if (keyCode == KeyEvent.KEYCODE_BACK) { 
                try{
                    GameBirdActivity.instance.finish();
                }catch(Exception e){}
                finish();
                System.exit(0);                 
            return true;
        } 
        return super.onKeyDown(keyCode, event);
    }
}
  •  <ignore_js_op>飛翔的圓(Flappy Bird)游戲源碼完整版

    運行截圖

  •  <ignore_js_op>飛翔的圓(Flappy Bird)游戲源碼完整版

    運行截圖

  •  <ignore_js_op>飛翔的圓(Flappy Bird)游戲源碼完整版


    運行截圖

  • 詳細說明:http://android.662p.com/thread-5878-1-1.html


向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI