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

Why do plant leaves change color?

When autumn comes, the leaves in the parks and on...

Be careful! Ubiquitous lasers may ruin your eyes

A recent news report said that a boy in Nantong, ...

What happened on the day the dinosaurs went extinct? Sturgeons know the answer

Sixty-six million years ago, an ornithischian pla...

What happens if you eat food that is one month past its expiration date?

When we encounter slightly expired food, we would...

Weibo Fantong & self-media traffic, how to make 1 million per month?

Preface | As everyone has experienced—— iPhones h...

What should I do if my website is blocked (K) by Baidu and Google?

Friends who have built websites have had this exp...

Geek Business Architecture Training Camp

Geek Business Architecture Training Camp Resource...

Why is MediaTek, which was so powerful last year, losing ground now?

MediaTek's performance last year was impressi...

Event planning and promotion: The planned activities never produce results?

Activities are a very common means of operation, ...

Marketing promotion plan for the May Day event!

Labor Day is coming soon. Have you thought about ...

22 truths about private domain traffic

The term private domain traffic has been popular ...