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

Experts explain: What exactly is a “wetland”?

The 14th Conference of the Parties to the Convent...

China's first satellite was successfully launched!

On the evening of February 23, the Long March 3B ...

KGI Securities: The worst is over for Apple iPad

KGI Securities analyst Ming Jiguo released his la...

I can tolerate being drunk, but I can’t tolerate being drunk on tea!

We all know that drinking tea can refresh the min...

Is there a worm in your brain? It's actually a global problem

Magnetic resonance imaging (MRI) of a 25-year-old...

Glue that can be used in water? Get a new underwater adhesion skill!

Produced by: Science Popularization China Author:...

Wuwei College Teacher Li Dong's five-day training camp for bull stock trading

Introduction to the bull stock trading resources ...

Brand marketing promotion, the essence of hunger marketing!

You must be familiar with this kind of page! A bi...

Aspartame is classified as a Class II carcinogen. Is it really dangerous?

Introduction: Staying away from aspartame is a wi...

Decline or turnaround, how can the points wall occupy the high ground?

The game of mobile marketing does have many cleve...

10 tips to help you write a hit video title

With the advent of the video era, in order to cre...

The dwarf killer: the African pygmy falcon

When we talk about birds of prey, we will definit...