Create Eclipse Game Plug-ins, part 2nd: Build and launch BB guns

Source: Internet
Author: User


While most users regard Eclipse as an integrated development environment for building java™ applications, it is actually more fundamental. Eclipse is a framework for building plug-ins that allows you to extend its functionality to solve almost any problem-just by leveraging a set of APIs and out-of-the-box libraries available. In this four-part "create Eclipse Game Plug-in" tutorial series, you will address one of the most pressing problems that most programmers encounter every day: How to take time out to play a fast video game without switching applications, and make it less obvious. The tutorial will develop a simple program to read the bugs that go into the view and smash them. The game will run as a plug-in in Eclipse, and the game shows how to write the Eclipse API, how to use the standard Parts Toolkit, the Open graphics library, and the lightweight Java game library.



About this series



In this series, we will describe the basic technologies, tools, and libraries that are used to create a fully feature-complete Eclipse plug-in, using the Standard widget Toolkit (SWT) and the OpenGL library to provide graphics. Part 1th describes how to build a simple video game framework that allows you to start and play the game within Eclipse by creating plug-ins. Part 2nd uses the basic framework created in part 1th to begin adding actual visual elements with Open GL. Part 3rd adds the actual game element, allowing users to interact with the graphic created in part 2nd. Part 4 puts together all the elements created in the first three sections to make sure they work together.



About this tutorial



This tutorial starts at the end of the first section and continues to add OpenGL and SWT. The following work will be done in this tutorial:



Create shapes, called bugs, based on the number of tasks in the Task list.



Create a shape that represents the BB gun and add color and texture.



Add the text when the bug is crushed.



Create a BB bomb that crosses the screen.



Learn how to use transformations to put all objects on the same canvas.



Prerequisite conditions



This tutorial assumes that the reader has basic knowledge of Java syntax and coding and Eclipse plug-in programming, as shown in part 1th of this series. Knowledge of graphic programming can be helpful, but not necessary. No knowledge of OpenGL is required.



System Requirements



The following software is required:



Eclipse Eclipse is the framework for creating Plug-ins in part 1th. Now continue to build the game plug-in with Eclipse. Please download Eclipse V3.2 M3 or above from eclipse.org. Eclipse SWT SWT is an Eclipse component package that is responsible for making windows, donated by IBM to Eclipse. Please download the SWT development version 3.2 M3 or above. Eclipse OpenGL needs to use OpenGL to create elements such as shapes. Please download Org.eclipse.opengl's experimental bindings for SWT 3.2 's version 0.5. Eclipse sample Plug-ins with OpenGL download the sample plug-in with one view using OpenGL. The source code in this plugin will be used as the framework for building your own custom OpenGL settings. Java Technology Eclipse and all of its plug-ins require java. Please download Java technology from Sun or IBM.



Overview and Settings



In the 1th part, we set up the plugin and now we can start OpenGL development. Let's take a look at the example that this tutorial will create and then set up an environment for OpenGL development.



Overview



OpenGL is a shocking library. It can create a scene at a very high speed. One of the reasons for this fast is that the OpenGL library uses hardware acceleration on the graphics card. Another reason for OpenGL speed is related to OpenGL libraries, which are optimized for machines with C + +. This eliminates the inherent high cost and dense image processing routines of Java technology. In this tutorial, you will use the OpenGL library to create shapes, text, and animations.



In the completion of the time, you will get a set, in this scene, you can use the space bar to paste the texture of the BB gun on the screen toward the worm launch BB bombs, in the middle of the hit when the word "pow!", as shown in Figure 1.








Related Article

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.