My favorites | Sign in
Project Logo
                
Search
for
Updated Nov 16, 2009 by brackeen
Eclipse  
Setup in Eclipse

Looking for more info? See also Alex Jeffery's tutorial.

About PulpCore Player

PulpCore Player has two main features not available in Appletviewer:

Note, PulpCore Player does not install a SecurityManager. Always test applets in web browsers, too.

Eclipse setup

There are two steps; first, you need to create the project, next, you need to create a Run Configuration for this project.

Making a project for the BubbleMark example, using Eclipse Europa:

  1. Make sure you have Pulp Core downloaded. The Bubble Mark demo is in the "examples" sub-directory.
  2. File->New->Java Project
  3. Name is whatever you want.
  4. Choose the "Create Project from Existing Source" radio button, and browse to wherever you downloaded Bubble Mark.
  5. Click "Next"
  6. Click the "Java Build Path" tab, and for libraries click "Add External JAR". Now, browse to the Pulp Core applet.
  7. Click "Ok"
  8. Build the project. There should be no errors.
  9. Go to the Bubble Mark's bin directory and zip up "ball.png" into an archive called "BubbleMark.zip"

Configuring the Run Dialog:

  1. Click Run->Open Run Dialog...
  2. Click "Java Applet" then click the New button ("New launch configuration")
  3. In the Main tab:
  4. In the Parameters tab:
  5. In the Parameters tab, add extra parameters:
  6. In the Arguments tab:
  7. In the Classpath tab:
  8. Click "Run"

Now you can use Eclipse "Run" button to run the apps, and the integrated debugger works too. Also, if Project->"Build Automatically" is checked, the PulpCore Player can reload the app when the code changes, often showing the same Scene that was previously loaded.

Reloading Scenes

If a Scene has a public no-argument constructor, the PulpCore Player can automatically jump to that scene when the code is reloaded. To reload, in PulpCore Player click "File->Reload".

This eliminates the need to traverse through start up scenes (like the Title, Menu, and Game Scenes) just to get to later scene (like HighScoreScene) every time the code changes. The HighScoreScene can be automatically loaded - as long as it has a public no-argument constructor.

Alternate Setup for a New Project

If you want to build off an existing project, the previous sections will prove helpful to you. However, some users want to start from scratch every time. In that case, you should probably build from one of the Ant template files, like so:

  1. In Eclipse, choose File->New Project...
  2. Choose "Java Project From Existing Ant Buildfile..."
  3. Browse to the pulpcore "templates" directory. Choose, e.g., the Quick template's "build.xml" file
  4. Check the checkbox "Link to the buildfile in the file system"
  5. After pressing "Finish" execute the applet by running the ant build script.

Step 4 is necessary because it links in Pulp Core's custom ant tasks (e.g., ProGuard).

Caveats

  1. Zipping your resources will get you into trouble once you start using fonts. Assuming you are developing in Eclipse, there are basically two options:
  2. The steps listed should also work on Ganymede, but feel free to mail the list if something breaks.

Comment by rajsite, May 25, 2009

Here is another Eclipse beginner tutorial: http://cloningtheclassics.com/getting-started-with-pulpcore/

Comment by rajsite, Aug 04, 2009

It might be of interest to note that the newest version of Eclipse ( Eclipse Galileo / Version 3.5 released June 24, 2009) now has the newest version of Ant ( Ant 1.7.1) so pulpcore builds right out of the box! People using older versions of eclipse will have to install Ant 1.7.1 manually.


Sign in to add a comment
Hosted by Google Code