Android Game Development Study Notes (1)

Source: Internet
Author: User
1. The game interface view is generally surfaceview or directly inherited from view
2. You can receive the motionevent clicking position in the view. getrawx () returns the screen coordinates, while getx () returns the coordinates in the view.
3 bitmapfactory: Do not call bitmap loading methods repeatedly. Each call consumes a lot of memory. It is best to put it at initialization.
4. Excessive memory consumption ProgramThe system automatically exits and displays the low memory information.
5. When detecting bitmap pickup, you can use a custom circle or square to replace the image shape, which facilitates Collision Detection and pickup.
6 when using matrix to locate the bitmap, pay attention to the order of the combination. Otherwise, an incredible problem may occur. Usually it is first deformed, then rotated rotate, and finally moved the translation
7 when using surfaceview to draw a graphic, you must ensure that the unlock operation of the canvas is executed, preferably put it in finally.
8 it is best to define all static variables in the Custom Application derived class. application is the beginning of the program, not the activity.

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.