hkdty211 |
Wysłany: Nie 20:34, 29 Maj 2011 Temat postu: platform pumps Android game development framework |
|
Android game development framework LGame-Android-0.2.5R
to be recommended? Download source code and libraries
as follows: http://loon-simple.googlecode.com/files/LGame-Android-0.2.5R.rar
basic components as shown below:
LGame-Android referred to as LA, is an ability to run on the Android system and its derivative systems compatible with the rapid development framework for 2D game, you can (in theory) and above running on Android1.1 environment. This release LGame-Android-0.2.5R Edition, by LGame-Simple-0.2.5 improved form, so it can be seen as LGame-0.2.5 to version 0.3 of the transition. For practical purposes, now it is mainly for the collection of LGame-0.3 version of the user views the release, and version 0.3 will also become one of the main branches of LGame framework.
LGame-Android version of the basic structure highly consistent with the PC version LGame, but have subtle differences, the gap will be gradually updated with the narrow version. Of course, the development of this framework is not the intent of the framework for the Qt-based, do not advocate a simple API for the package at the expense of platform features,Yves Saint Laurent Shoes My husband is used to bully , and his wife are used to, so will always maintain a certain local function exists.
First,leather platform pump Joke!, LGame in Android's very simple to use, as long as the introduction of the relevant libraries to run, not even configure the XML (if you prefer, you can.)
PS: If you use LGame for game development, then the xml even admob ad settings can also be omitted,patent platform pump Network digital Syntax, simply configure the ads in the LGame function accounts, keywords, display position, refresh time and other parameters can be used.
Second, one of the most simple LGame-Android application form by the following elements:
1, inherited from LGameActivity of Activity
view plaincopy to clipboardprint?
package org.loon.test;
import org.loon.framework.android.game.LGameActivity;
import android.os. Bundle;
public class Main extends LGameActivity {
public void onCreate (Bundle icicle) {
; / / this parameter is true that when the horizontal screen game, or vertical screen said.
/ / other initialization Admob ads when you can set the parameters, to avoid the cumbersome configuration xml file,
/ / This section will be added in the coming days.
this.initialization (icicle, false);
; / / game main form
this.setScreen (new TestScreen ());
; / / refresh rate
this.setFPS (30);
/ / whether to display the refresh rate
this.setShowFPS (true);
/ / whether to display the logo
this.setShowLogo (false); ;
/ / show the form
this.showScreen ();
}
}
package org.loon. test;
import org.loon.framework.android.game.LGameActivity;
import android.os.Bundle;
public class Main extends LGameActivity {
public void onCreate (Bundle icicle) {
/ / this parameter is true that when the horizontal screen game, or vertical screen said.
/ / other initialization Admob ads when you can set the parameters, to avoid the cumbersome configuration xml file,
/ / This section will be added in the coming days.
this.initialization (icicle, false);
/ / game main form
this.setScreen (new TestScreen ());
; / / refresh rate
this.setFPS (30);
/ / whether to display the refresh rate
this.setShowFPS (true);
/ / whether to display the logo
this.setShowLogo (false);
/ / show the form
; this.showScreen ();
}
}
2, Create Screen
view plaincopy to clipboardprint?
package org.loon.test;
import org.loon.framework.android.game.core.graphics.LGraphics;
import org.loon.framework.android.game.core.graphics.Screen;
import android.view.KeyEvent;
import android.view.MotionEvent;
public class TestScreen extends Screen {
public void draw (LGraphics g) {
}
; public boolean onKeyDown (int keyCode, KeyEvent e) {
return false;
;}
public boolean onKeyUp (int keyCode, KeyEvent e) {
return false;
}
public boolean onTouchDown (MotionEvent e) {
return false;
}
public boolean onTouchMove (MotionEvent e) {
return false;
}
public boolean onTouchUp (MotionEvent e) {
return false;
}
}
package org.loon.test;
import org.loon.framework.android.game.core.graphics.LGraphics;
import org.loon.framework.android.game.core.graphics . Screen;
import android.view.KeyEvent;
import android.view.MotionEvent;
public class TestScreen extends Screen {
public void draw (LGraphics g) {
}
public boolean onKeyDown (int keyCode, KeyEvent e) {
return false;
}
public boolean onKeyUp (int keyCode, KeyEvent e) {
return false;
}
public boolean onTouchDown (MotionEvent e) {
return false;
}
public boolean onTouchMove (MotionEvent e) {
return false;
}
public boolean onTouchUp (MotionEvent e) {
return false;
;}
}
this point, for any used LGame PC version of the friends, the rest of the operation to hundreds of times a. (Will be added gradually in the next few days the contents)
In addition, for Android efficiency considerations, but also added a new class of simple multi-threaded Screen, that ThreadScreen. Such inherited from the Screen, used to separate the specific business development and image refresh.
PS: This thread will be switched Screen in the Screen or the program closes automatically canceled.
has threads Screen:
view plaincopy to clipboardprint?
package org.loon.test;
import org.loon.framework.android.game.core.graphics.LGraphics;
import org.loon.framework.android.game.core.graphics.ThreadScreen;
import android.view.KeyEvent;
import android.view.MotionEvent;
public class TestThreadScreen extends ThreadScreen {
public void drawScreen (LGraphics g) {
;
}
/ / gameLoop always in a activities within the thread, the thread refresh rate can be setSynchroFPS () function controls.
public void gameLoop () {
/ / in ThreadScreen must be used to make the image refresh force repaint
}
public boolean onKeyDown (int keyCode, KeyEvent e) {
; return false;
}
public boolean onKeyUp (int keyCode,cheap shoes pumps, KeyEvent e) {
return false;
}
public boolean onTouchDown (MotionEvent e) {
return false;
}
public boolean onTouchMove (MotionEvent e) {
return false;
;}
public boolean onTouchUp (MotionEvent e) {
return false; ;
}
}
package org.loon.test;
import org.loon.framework.android.game.core.graphics . LGraphics;
import org.loon.framework.android.game.core.graphics.ThreadScreen;
import android.view.KeyEvent;
import android.view.MotionEvent;
public class TestThreadScreen extends ThreadScreen {
public void drawScreen (LGraphics g) {
}
; / / gameLoop always within an activity thread, the thread refresh rate can be setSynchroFPS () function controls.
public void gameLoop () {
/ / in ThreadScreen must be used to make the image refresh force repaint
}
public boolean onKeyDown (int keyCode, KeyEvent e ) {
return false;
}
public boolean onKeyUp (int keyCode, KeyEvent e) {
return false;
}
public boolean onTouchDown (MotionEvent e) {
return false;
}
public boolean onTouchMove (MotionEvent e) {
return false;
}
public boolean onTouchUp (MotionEvent e) {
return false;
}
}
with the PC version of the little differences:
In the Android version
to LGraphics alternative Graphics2D (in the PC version 0.2.5R also use such, API Graphics2D highly consistent with, and has been expanded), LImage instead of Image and BufferedImage (Bitmap package), LFont instead of Font . In addition, GraphicsUtils createImage series of functions in the Android version is returned to the LImage,red peep toe, getFont series function to return to the LFont, others remain unchanged.
Android version of the partial lifting of:
PShadowEffect class, LMagnifier class, LPlayer categories: the three types used in the PC version of pixel rendering to complete, and the same pixel mapping mode, the speed of Android is the next tragedy, left to the 0.3 version instead OpenES to achieve ... ...
PC version of the whole media package: This section LGame-Android version of the package directly MediaPlayer, provide AssetsSound and AssetsSoundManager. (In fact, the data stream as MediaPlayer unfriendly, so LGame-Android file must be specified in audio folder As for assets, the relevant class to
details on a number of settings:
fixed horizontal and vertical version for most of the game, we all need in the activity in the AndroidManifest.xml configuration tag android: configChanges = Furthermore, regardless of any need to read and write permission before the operation, are sure to have configured within AndroidManifest.xml relevant operating authority, or action can not be effective. (Such as network connections, shall be marked: <uses-permission android:name=For details, please refer to the documentation, not repeat them here.
Finally, to everyone and easy commissioning with LGame-Android Also included with the PC version of the LGame-0.2.5R.
Download source code and libraries
as follows: http://loon-simple.googlecode.com/files/LGame-Android-0.2.5R.rar
PS: This blog article is not over yet, will be completed by about five days after another meeting.
----------------
cup brother today, and Beijing has just rain,platform pumps, go late + no umbrella | | |. Of oversight, did not finish this article in advance and had to slowly update it ... ... can be considered better patient comrades can test their side edges and little shout to discuss library is expected to add around five days, finished it, in short, do not bounce ... ...
In addition, we need not worry about efficiency, core version 0.3, OpenGL ES has been replaced, and is expected to release during the period from September to October.
this blog from CSDN, reproduced, please credit: http://blog.csdn.net/cping1982/archive/2010/06/01/5640944.aspx |
|