Skip to main content


developerWorks  >  Open source  >

Create an Eclipse game plug-in, Part 2: Building and firing a BB gun

How to build fun plug-ins for Eclipse using the SWT, OpenGL, and the LWJGL

developerWorks

Level: Intermediate

Tyler Anderson (tyleranderson5@yahoo.com), Freelance Writer, Stexar Corp.

28 Mar 2006

Register now or sign in using your IBM ID and password.

Although most users think of Eclipse as an integrated development environment for building Java™ technology applications, it is really something much more basic. Eclipse is a framework for building plug-ins, allowing you to extend its functionality to solve nearly any problem -- just by leveraging a set of APIs and readily available libraries. In this four-part "Create an Eclipse game plug-in" tutorial series, you will solve a pressing problem most programmers encounter daily: how to break away to play a quick video game without switching applications and making it obvious. You'll develop a simple game that will read the bugs entered on the a view and blast them to bits. The game will run inside Eclipse as a plug-in, that will demonstrate how to write to the Eclipse API, while using the Standard Widget Toolkit, the Open Graphics Library, and the Lightweight Java Games Library.

In this tutorial

This tutorial, Part 2 of a four-part series, goes beyond what was accomplished in Part 1 by creating the BB gun, the bugs, and the BBs using Open Graphics Library (OpenGL). Upon completing this tutorial, we'll watch the BBs you fire whiz across the screen!

This tutorial continues where you left off in Part 1 by adding OpenGL and the SWT to the mix. You'll do the following:

  • Create shapes based on the number of tasks in the task list that will be known as bugs

  • Create a shape for the BB gun and add color and texture

  • Add text to the works for when bugs get blown up

  • Create BBs that zip across the screen

  • Learn how to place all the objects on the same canvas using translations

Prerequisites

This tutorial assumes you have the basic knowledge of Java syntax and coding, and about Eclipse plug-in programming, as shown in Part 1 of this series. Graphics programming knowledge is a plus, but not required. Knowledge of OpenGL is not required.


System requirements

You need the following:

Eclipse
Eclipse is the framework for creating the plug-in in Part 1. Now you'll continue leveraging Eclipse in building the gaming plug-in. Download Eclipse V3.2 M3 or higher from Eclipse.org.
Eclipse SWT
The SWT is the Eclipse widgets package for window-making, donated to Eclipse by IBM. Download the SWT development version, 3.2 M3 or higher.
Eclipse OpenGL
The OpenGL libraries is needed for creating shapes and more. Download the experimental org.eclipse.opengl binding, version 0.5 for SWT 3.2.
Eclipse Example Plug-in using OpenGL
Download the Example plug-in with a view that uses OpenGL. You'll use the source code in this plug-in as a framework for building your own custom OpenGL scene.
Java technology
Eclipse and all its plug-ins need Java. Download Java technology from Sun or IBM.


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed


More in this series:
Create an Eclipse game plug-in