Ogengine environment construction under Win7 system

Source: Internet
Author: User

Ogengine_ Environment Construction

Preface

Ogengine Open Source Engine is an open source free, easy to learn, efficient and practical Android game engine, suitable for different levels of professional personnel, reduce the majority of users on the Android platform to develop the game threshold. The engine can be used for the full development of the game framework, and provides a lot of fast, high-performance memory management technology, while supporting 3rd party jar package Access, there is unlimited scalability.


Build WIN7 System Development Environment

1. Download Jdk,jdk8 There is a problem with installing under Windows XP, so install it under WIN7. WIN7 operating system has 32-bit and 64-bit, respectively to download the corresponding JDK8 version

32-bit: Jdk-8u5-windows-i586.exe

64-bit: Jdk-8u5-windows-x64.exe

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. After installing the JDK and JRE, in the "Computer-Properties-Advanced system Settings-advanced-Environment variables", add the JAVA system variables, in the "System variables" area of the variable named "java_home" variable, the value of the JDK is the installation path, such as "e:/java/ Jdk1.8.0_05 ". Then add the java_home to the system variable path, edit open the system variable path, add the code in double quotes before the value of the original variable "%java_home%/bin;", note that the separator symbol cannot be missing.

3. After installing the JDK, run the JDK command in the CMD Command Line window: Javac. Its successful effect is shown in 1:

4. Download Android Development Tools (ADT) to Android official website

Http://developer.android.com/sdk/index.html

This package contains sdk+eclipse for user-friendly development.

Unzip the download file containing the SDK folder and the Eclipse folder

5. If you want to use commands such as adb/android at the terminal using the command line, you need to configure the environment variables:

1). Computer-Properties-Advanced system Settings-advanced-environment variables, edit open system variable Path

2). Variable value for Android installation directory plus/tools; Android installation directory plus/platform-tools;

3). Create: Touch. Bash_profile

4). Write the following in the file (do not copy directly):

Cases:

E:\android-sdk-r20-windows\platform-tools; E:\android-sdk-r20-windows\tools;

The directory is not fixed and needs to be the tools directory and Platform-tools directory that point to the Android SDK, depending on the situation.

6. Execute the Eclipse.exe in the Eclipse directory and configure the workspace storage path

7. If necessary, you can update the required API in SDK Manager


Ogengine Engine jar Package Import

1) Download Ogengine source code or JAR package:

Website :http://www.apkcool.com:84/download/downloadEngine.jsp

2) Create an Android project

Under eclipse file->new->project...->android Project from existing code.

Enter the application name in application name and the project name and package name will be output by default, click Next

3) Select the project related settings, by default click Next to

4) Next, you can choose the icon you want

5) Click Next...finish to complete the initial project creation



HelloWorld 's Sledgehammer Pee

1. The Android development project was successfully created in the previous section, and next we will import the Ogengine source code project and start our game development learning journey ... Figure 2 is the Android project directory structure that we just created:

2. Import the Ogengine engine jar package We downloaded into the Libs directory

3. Open Mainactivity.java, change mainactivity extends activity to mainactivity extends Gameactivity, And overloads some of these functions oncreatepixelperfectengineoptions (), Onloadresources (), Onloadcomplete ()

Code Overwrite method parsing:
Oncreatepixelperfectengineoptions () is called when the game engine is loaded by the activity, where the camera and engine objects are initialized. Depending on the policy, the engine can scale the image at different screen sizes while maintaining the original aspect ratio.
The Onloadresources () method is called when the resource is loaded. Here you need to create a texture object to hold the Textureregion object for loading the image. As for how textureoptions is rendered as a picture, it will be explained in the following sections. Finally, the map object is loaded into the texturemanage of the engine. (The picture is already ready under the Assets/gfx folder clip)
The Onloadcomplete () method is called at the completion of engine initialization and can be jumped into the scene


4. Add LOG.V ("mainactivity", "Hello World") to the Onloadcomplete () method;

Then run it to see the print in Logcat


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.