Don't step on the white block game source code

Don't step on the white block game source code

Source code introduction

This project is a game source code based on the Android OGEngine engine.
Source code running screenshot

Source code snippet:

  1. public   class MainActivity extends GameActivity {
  2. @Override  
  3. protected   void onCreate(Bundle pSavedInstanceState) {
  4. super .onCreate(pSavedInstanceState);
  5.   
  6. }
  7.   
  8. @Override  
  9. protected PixelPerfectEngineOptions onCreatePixelPerfectEngineOptions() {
  10. PixelPerfectEngineOptions pixelPerfectEngineOptions = new PixelPerfectEngineOptions(
  11. this , ZoomCamera. class );
  12. pixelPerfectEngineOptions
  13. .setScreenOrientation(ScreenOrientation.PORTRAIT_FIXED); // Set the screen to vertical  
  14. pixelPerfectEngineOptions
  15. .setPixelPerfectMode(PixelPerfectMode.CHANGE_HEIGHT); // Adaptation mode, here set to "keep width unchanged, change height"  
  16. pixelPerfectEngineOptions.setDesiredSize(ConstantUtil.DESIRED_SIZE); // Reference size  
  17.   
  18. return pixelPerfectEngineOptions;
  19. }
  20.   
  21. @Override  
  22. protected   void onLoadResources() {
  23. // Load related initial resources, etc.  
  24. LogUtil.d( "Start loading resources..." );
  25. RegionRes.loadTexturesFromAssets(Res.ALL_XML);
  26. FontRes.loadFont( 128 , 128 ,
  27. Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 40 , true ,
  28. Color.RED, ConstantUtil.FONT_NAME_TIMER);
  29.           
  30. FontRes.loadFont( 256 , 512 ,
  31. Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 50 , true ,
  32. Color.BLACK, ConstantUtil.FONT_NAME_RESULT);
  33.   
  34. }
  35.   
  36. @Override  
  37. protected   void onLoadComplete() {
  38. //After loading the resource  
  39. LogUtil.d( "Loading resources completed..." );
  40. this .startScene(GameScene. class ); // Start the game scene  
  41. }
  42.       
  43. @Override  
  44. protected   void onPause() {
  45. super .onPause();
  46. this .getEngine().stop();
  47. }
  48.       
  49. @Override  
  50. protected   synchronized   void onResume() {
  51. super .onResume();
  52. this .getEngine().start();
  53. }
  54.   
  55. @Override  
  56. protected   void onDestroy() {
  57. super .onDestroy();
  58.           
  59. android.os.Process.killProcess(android.os.Process.myPid());
  60. }
  61. }

Source code download: http://download..com/data/1980598

<<:  Android waterfall photo wall implementation, experience the beauty of irregular arrangement Demo

>>:  Imitation iPhone password lock effect

Recommend

Is lupus, the “immortal cancer”, a terminal illness?

Audit expert: Wang Xuejiang Professor of Pathophy...

2019 Advertising Industry Mid-Year Observation

Advertising that is not aimed at growth is a hool...

An article about ButterKnife to make the code more concise

Preface Android developers all know that each tim...

Want a “screen-sweeping” promotion for NetEase Music? Here are 8 ways

Why does the traffic increase when users are mock...

How can we operate a Baidu bidding account well?

For many people who do Baidu bidding promotion, h...

How many Tik Tok views are considered popular? Tips to become popular on TikTok

This article mainly introduces how many Douyin pl...

Marketing plan strategy!

The outline is as follows: 1. Clarify various pro...

Why is KFC’s social death event so popular?

KFC’s social death event is coming! In the past t...

Are the colorful fish meant to attract natural enemies to eat them?

In daily life, we often see some colorful fish. F...

Li Mingjie Falls in Love with Data Structure and Algorithm Season 3

Li Mingjie Falls in Love with Data Structure and ...

How do educational and training institutions attract new customers online?

On May 27, I was invited by a teacher from an edu...

Have you ever encountered these "weird things" when driving in a tunnel?

The North-South Cross-Island Corridor, Shanghai’s...