Java (Android) Game Development Framework LGame-0.2.7 released

Source: Internet
Author: User

Update content from 2010-08-19:

 

1. Added multi-touch support for Android.

 

2. added a set of simulated buttons to implement emulator monitoring using screen (this listener corresponds to eight button events.

 

3. Added function extensions in some details. For example, the android lsystem class has provided a large number of system environment parameters like javase.

 

4. Fixed Chinese garbled characters in some environments and the new framework bug (the earlier version of lgraphics is similar to the implementation of the j2_based architecture. We recommend that you update this version ).

Source code and JAR:

Http://loon-simple.googlecode.com/files/LGame-0.2.7.7z

 

Function Changes enabled for Android:

 

In version 0.2.7, the game initialization method is slightly changed, and the entry function is changed to onmain.

 

Public class main extends lgameandroid2dactivity {</P> <p> Public void onmain () {<br/> // This. initialization (false, glad. left, "AdMob ID", 60); <br/> This. initialization (false); <br/> This. setshowlogo (false); <br/> This. setscreen (New emulatortest (); <br/> This. setfps (50); <br/> This. setshowfps (true); <br/> This. showscreen (); <br/>}< br/>}

 

Add a simulated button
:

 

To adapt to the complex operating environment and the needs of fighting games, a set of analog buttons are added for the Android and javase lgame versions. emulatorlistener listening can be called on any screen.

 

The basic usage is as follows:

 

Package Org. loon. test; <br/> Import Org. loon. framework. android. game. action. sprite. colorbackground; <br/> Import Org. loon. framework. android. game. core. emulatorlistener; <br/> Import Org. loon. framework. android. game. core. graphics. lcolor; <br/> Import Org. loon. framework. android. game. core. graphics. screen; <br/> Import Org. loon. framework. android. game. core. graphics. device. lgraphics; <br/> Import android. view. key Event; <br/> Import android. view. motionevent; <br/> // all screens (screen, threadscreen, and canvasscreen) automatically call the analog button as long as emulatorlistener is enabled. <br/>. <Br/> public class emulatortest extends screen implements emulatorlistener {<br/> private colorbackground background; <br/> Public emulatortest () {<br/> // you can use the getemulatorbuttons function to return the array set of the current simulated button. <Br/> // getemulatorbuttons (); <br/>}< br/> // added functions for version 0.2.7, after the screen build is complete, execute and load the data in it. <br/> Public void onload () {<br/> // create a red background, the size is 48x48 <br/> This. background = new colorbackground (lcolor. red, 48, 48); <br/> // center (colorbackground itself is a genie) <br/> This. centeron (background); <br/> // load <br/> This. add (background); <br/>}< br/> Public void draw (lgraphics g) {<br/>}< br/> // added functions for version 0.2.7, built like a Rokon function with the same name, it can only be Trigger. <Br/> Public void ontouch (float X, float y, motionevent E, int pointercount, <br/> int pointerid) {<br/>}< br/> Public Boolean onkeydown (INT keycode, keyevent e) {<br/> return true; <br/>}< br/> Public Boolean onkeyup (INT keycode, keyevent e) {<br/> return true; <br/>}< br/> Public Boolean ontouchdown (motionevent e) {<br/> return true; <br/>}< br/> Public Boolean ontouchmove (motionevent E) {<br/> retur N true; <br/>}< br/> Public Boolean ontouchup (motionevent e) {<br/> return true; <br/>}< br/> Public void onupclick () {<br/> If (background! = NULL) {<br/> background. move_up (4); <br/>}< br/> Public void ondownclick () {<br/> If (background! = NULL) {<br/> background. move_down (4); <br/>}< br/> Public void onleftclick () {<br/> If (background! = NULL) {<br/> background. move_left (4); <br/>}< br/> Public void onrightclick () {<br/> If (background! = NULL) {<br/> background. move_right (4); <br/>}< br/> Public void oncancelclick () {<br/> If (background! = NULL) {<br/> background. setvisible (false); <br/>}< br/> Public void oncircleclick () {</P> <p >}< br/> Public void onsquareclick () {<br/>}< br/> Public void ontriangleclick () {<br/> If (background! = NULL) {<br/> background. setvisible (true); <br/>}< br/> Public void uncancelclick () {<br/>}< br/> Public void uncircleclick () {<br/>}< br/> Public void undownclick () {<br/>}< br/> Public void unleftclick () {<br/>}< br/> Public void unrightclick () {<br/>}< br/> Public void unsquareclick () {<br/>}< br/> Public void untriangleclick () {<br/>}< br/> Public void unupclick () {<br/>}< br/>

 

You can use the new analog buttons to easily implement a fighting game or a game that requires complex operations:

 

 



For basic usage of the framework, see this article: http://blog.csdn.net/cping1982/archive/2010/08/06/5794380.aspx

 

The following figure shows some sample programs that were released earlier (download the lgame release earlier ):

The following figure shows some sample games developed by lgame-simple.

 


Source code and JAR:

Http://loon-simple.googlecode.com/files/LGame-0.2.7.7z

 

 

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.