Posted by samson on May 26, 2010 in
PulpCore
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.
Tags: class, Netbeans, post, pulpcore, setAnchor, sprite, way
Posted by samson on May 25, 2010 in
PulpCore
After talking about Pulpcore in a previous post and another post on Netbeans IDE, let’s talk about using them together to create our first ‘Hello World’ Pulpcore game.
Please have Pulpcore Libraries Extracted to a location on your local hard drive and Netbeans IDE properly installed before you begin the following.
Navigate to the Netbeans Module for Pulpcore page using this link. Follow the installation instructions by the author of the netbeans Module.
I have duplicated the instructions here for easy access, it is simply 9 Steps.
- Download the Netbeans Module (nbm) file.
- Open Netbeans
- Navigate to “Tools” -> “Plugins”
- Click on the “Downloaded” tab.
- Click “Add Plugins”.
- Find your downloaded nbm file.
- Click “Open”.
- Click “Install”.
- Follow on-screen instructions.
Now you are ready to create the Hello World program. Follow these steps:
- Create a New Project
- Expand ‘Samples’
- Select ‘Java’
- Select ‘PulpCore Full Template’
- Click Next
- Type in ‘Hello World’ where it saids ‘Full’
- Copy down the Project Location, this is usually your ‘NetBeansProjects’ folder within your ‘My Documents’ folder.
- Click on ‘Finish’
- Press ‘Shift+F11′ to ‘Clean and build’
This will actually build your Pulpcore program already and if you click on Netbean’s build-in ‘Run Project’ buttons, it will launch the program. However, I don’t suggest this method for testing your code as the player doesn’t exit properly in Netbeans yet. It would be more ideal to launch the program directly with a browser. So, navigate to the Project Location you copied from Step 7 above and find the NetBeansProject folder. The folder structure should be like this:
‘NetBeansProject’ -> ‘Hello World’ -> ‘build’ -> ‘applet’
Find index.html and launch it using your browser.
If all goes right, you should see something like this.

Tags: Hello World, Hello World program, IDE, location, nbm, Netbeans IDE, Open, post, pulpcore
Posted by samson on Apr 22, 2010 in
Java
My first time using NetBeans, it was barely an IDE. Actually, it was just a platform that allows Java Developers to test their JavaBeans on. Running on Java 1.3.
So, since 1.3 to the end of Java 1.4, I have been using a simple IDE called Gel. Gel’s developers have stopped development since the launch of Java 1.5, and actually becomes non-usable since Generics was released. So I have been on the search for another IDE. At one point, I tried the famous Eclipse IDE however was extremely disappointed at the slow responses Eclipse have. JDeveloper was not a bad solution, however I personally am not very comfortable with using something that is branded with Oracle with MySQL or PostgreSQL.
After jumping into bed with several Java IDEs, I’ve decided to give NetBeans 6.5.1 another try. This time, I think I am set for my Java Development. It not only have a decent speed while loading up, it supports two other languages that I use all the time, C++ and PHP.
I personally think NetBeans have come a long way, one of the most amazing tool is the GUI interface. I recall that back in the days of Java 1.4, to create a typical Java GUI, I must code the the GUI piece by piece in code. However with the GUI interface editor, drag and drop with double clicking to code. This made GUI design and GUI coding A LOT easier then when I was learning Java.
To obtain the Netbean IDE please go to http://netbeans.org/. and download the version that fits your developmental system.
Tags: development, Eclipse, Eclipse IDE, Gel, Generics, java, Java Developers, Netbeans IDE, platform
Posted by samson on Apr 7, 2010 in
PulpCore
Recently I came across an OpenSource project designed to make java more updated with simple 2D game programming. Flash, Silverlight and other secondary tools have long since dominate this client side, interactive coding portion of the web. HTML 5 is still in its infancy, and ultimately painful to implement. Of course, to some, Java is as painful to learn. But for most people who have been taking advantage of Java’s server side power, it would be relatively fun to go back to GUI programming.
Pulpcore is really not a brand new idea. Java’s applet attempts back in the mid ninties was a complete failure, yet super foresight on Sun’s part. Java Applet’s failure is actually due to the limitation in computing power back in the 90s. The Java VM is not light to load and run, yet most computers back then would have been under 100 mhz! That is like a joke compared to today’s cpu speed, measured in GHz instead!
So if there is a way to load the applet code without all the annoying java protection, java can actually be more efficient then flash!
Click here to take a look at Pulpcore’s main page!
Tags: games, java, pulpcore
Posted by samson on Jun 27, 2009 in
Computer World
Based on my current reviews on all the Learning Management systems available, I have to say that Moodle, even with its popularity, is not as promising as Sakai can be. The ultimate technology that drove me to this decision is that Sakai is Apache/Tomcat based where as Moodle is Apache/PHP based. By the nature of Tomcat, Sakai LMS is written natively in Java where as Moodle is in simple PHP scripts.
I am not saying that PHP is useless or other possible degrading terms, but I do believe that PHP is not as stable, reliable and ultimately as powerful as Java. One of the underlying abilities of WebCT that I personally really like is its Java back end. The ability to actually create Client-Server communication in an N-Tier architecture, that’s really amazing. This is something that, even with the emerging of Web 2.0 and HTML 5 standards, PHP can never really achieved. It can simulate it, but not achieve.
Another special abilities that Java based LMS, such as WebCT, can do while PHP based LMS can not accomplish, are the server side initialization events. In WebCT, this includes all the private messaging, the invitation to chat rooms, sharing of pictures. Since we have a real Client-Server connection, the client does not have to revisit the server on a pre-determined schedule to obtain updated information. It is notified when new events need its users’ attention, just imagining the graphical version of this network gives me a headache.
So, my suggestions is that if you are planning on using your LMS as the general Portal for all your students and staff, choose very carefully before you make a decision, since we all know, once you got used to something, you don’t want to adopt something different.
Tags: LMS, Moodle, WebCT