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

4 Things I Learned Developing My First Swift App

My app development project this summer is Instant...

How did you come up with the title? 7 steps, from conception to hit product!

How did you come up with the title ? Do you recei...

After wearing a mask for so long, what role does it play?

As the global epidemic remains so severe, there i...

What is the origin of the “UFO” that is flooding the circle of friends?

Let’s learn about some common “UFOs”. When variou...

A universal formula for user growth, common across industries

Whether it's designing an event to attract 10...

A complete analysis of the Toutiao search account setup and delivery ideas

As a new search platform launched this year, Tout...

How to take advantage of the popularity? I have summarized 19 techniques!

Hot spots are the fulcrum for operators to pry th...

A brief discussion on user stratification in user operations

I have talked to you about user operations before...

Modularity and AR phones: Did Lenovo bet on the right trend?

Not long ago, Lenovo held the Tech World Technolo...

After WWDC, Apple left many doubts, and Cook's ambitions began to emerge

Now Apple's Worldwide Developers Conference h...