Pulpcore continued…
After publishing my previous post on Pulpcore, I realized that I have forgotten one of the major part I intended for that post, how to update your NetBeans Pulpcore libaries to the latest release. At the time of writing, Pulpcore is on Version 0.11.5.
How do I know which version of Pulpcore Libaries I am using?
That is actually really difficult to answer, as I don’t recall seeing any ‘Pulpcore version’ indication in the compiled code, the only way you can tell is from the console within the Pulpcore player itself. However, as we are all Java Adicts, we have a better way of finding that out from the code, we look for deplicated methods in the Library!
In class Pulpcore.sprite, there is a method called ‘setAnchor(int anchor)’
It was originally designed to allow users to set the anchor point on a sprite allowing for a easier point of reference. In the original pulpcore libraries, the method setAnchor would take in an interger presenting one of nine points, which looks like this:
NW N NE
+----+----+
| |
W + * + E
| |
+----+----+
SW S SE
With a predefined list of integers in the Sprite class in the form of Sprite.NORTH, Sprite.NORTH_EAST, etc…
However, this method is now deplicated in Pulpcore 0.11.5, the new setAnchor accepts two double, AnchorX and AnchorY.
setAnchor(double anchorX, double anchorY)
(0.0,0.0) (0.5,0.0) (1.0,0.0)
+----------+----------+
| |
| |
| |
| (0.5,0.5) |
(0.0,0.5) + * + (1.0,0.5)
| |
| |
| |
| |
+----------+----------+
(0.0,1.0) (0.5,1.0) (1.0,1.0)
With this as our weapon, we can easily find out whether we are using the newer Pulpcore Libaries or not.
NetBeans upgrade proceedures
So, continuing from yesterday’s post, now you have your first ‘Hello World’ program in pulpcore, let’s convert it to Pulpcore 0.11.5!
- Expand the file browser tree under projects like so…

- Double click on HelloWorld.java
- Navigate till you find something that looks like this
If this code compiled fine as it is, then you are not using 0.11.5 or later. - To ensure we are indeed not using 0.11.5, change the code from (Sprite.CENTER) to (0.5, 0.5), Netbean’s compiler errors should immediately light up like a christmas tree like how we have here.

- Open your favorite file explorer and navigate to your NetBeans files. (eg: c:\NetBeansProjects\Hello World\pulpcore_dependencies\)
- Open your favorite file explorer and navigate to where you have extracted the Pulpcore 0.11.5 files, if you don’t have it, obtain it here!
- Navgate, in your Pulpcore folder, to the build folder. (eg: C:\pulpcore-0.11.5\build\)

- Select all of those JAR files and copy them over to your NetBeans Project folder’s pupcore_dependencies folder, replacing everything.
- Go back to NetBeans and click on the ‘Clean and build’ button
, you should see compile error gone, replaced by 18 warnings saying that the setAnchor method is deplicated. - At this point, your Pulpcore library is 0.11.5, to remove the warnings, simply go over all the setAnchor methods and replace them with the newer style instead of the older setAnchor method style.