[Beginner in android game development] simple game framework

Source: Internet
Author: User

In the past two days, I have nothing to learn about game development. After reading some materials, I am ready to start. For future coding convenience, I first wrote a simple game framework to help myself do my exercises later.
If there are no special requirements in the future-such as opengl or something, we will try to use this simple framework for implementation. If there are optimizations, they will be updated throughout the process. If there are any problems, I hope you can help me provide some suggestions.

My basic refresh Thread class

  LoopThread   DEBUG =  Object lock =     RUNNING = 1    PAUSE = 2    STOP = 0  runState = WeakReference<CustomSurfaceViewCallBack>=  WeakReference<CustomSurfaceViewCallBack> .runState =.getName()+" exit, lock="+  loop() (runState!= (runState === (callBack == = (runState ==500(runState== (runState==   =  .runState = .runState = .runState =( 

 

Refresh Interface

     

Basic game display interface

CustomSurfaceView SurfaceView = singleThread = setSingleThread (dt! = UnsupportedOperationException ("must invoke setSingleThread before surfaceCreated ". singleThread = surfaceChanged (SurfaceHolder holder, format, width, (singleThread) {= SingleThread (= DrawThread (= ProcessThread (= (t = (dt! = (Pt! = (Dt! = (Pt! = DrawThread. setName ("DrawThread --" + SingleThread. setName ("SingleThread --" + ProcessThread. setName ("ProcessThread --" + (callBack! === (Canvas! = (Canvas! =View Code

 

The implementation of the display is also the besell curve to be displayed in the previous article. Of course, implementation is much simpler than the original code.

  PathActivity  =  PathView(   PathView     = 0xaf22aa22= =  === 0.8f*= 0.8f*   surfaceChanged(SurfaceHolder holder,  format,   50, 50/2 

 

I hope you can correct me more. It is inevitable that many threads are synchronized.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.