Small-size Java game design [Confused]

Source: Internet
Author: User

Repaint redraws a part.

Note efficiency: syntax-related and processing mechanisms.

Two types of small size design are important: the size of the JAR file of the MIDlet kit and the size of the space occupied by the MIDlet kit installed on the mobile phone (if the JAR file is not installed according to its packaging status ). The size of the latter depends on the specific implementation of the mobile phone. However,
The jar file size is the predicted ID of the required installation space. Because the JAR File Format sets an independent header for each class file, it is recommended to use fewer classes as much as possible. For this reason, the MIDlet is not as "object-oriented" as a common Java program ". In particular:
• Each 'thes' has only one class. For example, if you use a class to complete all things, do not divide it into classes such as "model", "View", and "controller. • Restrict the use of various interfaces-an interface is a special class. As defined, it does not provide functions. An interface is used only when multiple implementations need to be processed in the same released MIDlet.
• Use "unsung package"-placing all the MIDlet classes in a package with the same name will only increase the size of the midletjar file-only add a package statement for the import and export operations. • Consider using source code preprocessors instead of 'static
Final' constant-each such constant occupies the space of the JAR File

Unfortunately, the typical method to reduce inter-class dependency is to use the Java interface, which increases the size of the Library (see section 3.1 ).

After loading a large image from a file, you can plot each frame using the following methods: G. setclip (X, Y, frame_width, frame_height); G. drawimage (fivemenimage,
X-frame_width * framenumber, Y, graphics. Top | graphics. Left); here, the value of framenumber ranges from 0 to 4; press {0,
1, 2, 3, 4, 3, 2, 1} loops. You can create an animation where someone is walking. If you want to use the paint method for further painting, remember that it is necessary to change the image editing window again.
14

I think 8 is deep enough... There are all these books...

1. Keys in midp1.0 are blocked. That is to say, you cannot press the attack key while holding the direction key. This is annoying when playing games.

2. The key codes of various mobile phones are different. The left and right soft buttons and the navigation keys.

3. Another function is keyrepeated, which is not supported by all mobile phones. But it seems that the support is also very poor, and the speed of repetition is surprisingly slow, it is better to press it by yourself.

4. There are also a few pointer-related things used on mobile phones with touch screens, such as PDAs.

5. I didn't think of it now...

Haha, the first time I visited the author's blog, I picked a thorn. 8. Pai_^

If the landlord knows a better solution to problems 1 and 2, please kindly advise ^_^

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.