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

Heart regeneration is no longer a dream? Please "patch" the failing heart

The heart is one of the most important organs in ...

Why are succulents drought-tolerant?

Produced by: Science Popularization China Author:...

App Store launch rules, app launch, app release, app promotion

Rules for the first release of App Store 1. Initi...

Win10 mobile preview version is online: only a few devices are supported

Beijing time, February 13 morning news, we have s...

A complete guide to advertising on TikTok!

You may be running campaigns on more established ...

5 core strategies for brand promotion at Station B

Nowadays, Bilibili has become one of the most pop...

How to develop a complete user growth system architecture?

If you learn the right principles in the field of...

Before letting the Earth wander, let’s study this more realistic threat

During the Spring Festival of the Year of Guimao,...