Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Create an Eclipse game plug-in, Part 3: Gaming the system

We put the player in the loop

Tyler Anderson (tyleranderson5@yahoo.com), Engineer, Stexar Corp.
Tyler Anderson graduated with a degree in computer science from Brigham Young University in 2004 and graduated with a master's degree in computer engineering in December 2005, also from Brigham Young University. He is currently an engineer for Stexar Corp., based in Beaverton, Ore.

Summary:  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. Part 3 games the system up with collision detection between the bugs and BBs, destroying the bugs.

View more content in this series

Date:  21 Apr 2006
Level:  Intermediate PDF:  A4 and Letter (124 KB | 23 pages)Get Adobe® Reader®

Activity:  15096 views
Comments:  

Before you start

This series is for developers interested in building gaming plug-ins for Eclipse using OpenGL. This tutorial goes beyond Part 2 by adding movement for the BB gun, as well as collision detection in OpenGL.

About this series

In this four-part series, you will be introduced to the basic techniques, tools, and libraries used to create a full-featured Eclipse plug-in that uses the Standard Widget Toolkit (SWT) and OpenGL libraries for providing graphics. Part 1 looked at building the framework for a simple video game to be launched and played inside Eclipse by creating a plug-in. Part 2 took the basic framework created in Part 1 and started adding the actual visual elements using OpenGL. Part 3 adds the actual game elements, enabling the user to interact with the graphics created in Part 2. Part 4 takes everything created in the previous three parts and makes sure it all works properly.


About this tutorial

This tutorial continues where we left off in Part 2 by making the game come to life with the shapes and functionality we've already created. Here, we'll do the following:

  • Add movement for the BB gun
  • Add collision detection for BBs and the bugs, causing hit bugs to blow up and disappear, displaying the text "POW"

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

The following tools are needed to follow along:

Eclipse
Eclipse is the framework for creating the plug-in created in Part 1. Now we'll continue leveraging Eclipse in building the gaming plug-in. Download Eclipse SDK 3.2 M3 or later.
Eclipse SWT
SWT is the Eclipse widgets package for window making, donated to Eclipse by IBM. Download SWT 3.2 M3 or later.
Eclipse OpenGL
You need the OpenGL libraries for creating shapes and more. Download the experimental org.eclipse.opengl binding, version 0.5 for SWT 3.2 for your system.
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 technology. Download Java from Sun or IBM.

This tutorial assumes basic knowledge of Java language syntax and coding and about Eclipse plug-in programming, as shown in Part 1. Graphics programming knowledge is a plus, but is not required. Neither is knowledge of OpenGL.

1 of 11 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=108211
TutorialTitle=Create an Eclipse game plug-in, Part 3: Gaming the system
publish-date=04212006
author1-email=tyleranderson5@yahoo.com
author1-email-cc=troy@backstopmedia.com