<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>Fully Qualified main class here</Main-Class>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Insert SVN Revision Number into MANIFEST.MF
<project>
<scm>
<connection>scm:svn:http://svn/folder</connection>
<developerConnection>scm:svn:http://svn/folder</developerConnection>
<url>http://svn/folder</url>
</scm>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<SCM-Revision>${buildNumber}</SCM-Revision>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</project>
jConsole with Java 1.5
Start java application with the following arguments
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=<port>
-Dcom.sun.management.jmxremote.authenticate=false
Run jconsole from the command line pointing the to PID of the java process
jconsole <PID>
for example
jconsole 1234
Problem:
Create a load test that submits a web form containing a unique token to prevent multiple form submissions.
Solution:
jMeter 2.6
Use jMeter Regular Expression Extractor ( Found in Right Click Menu >> Add >> Post Processors >> Regular Expression Extractor)
How To:
On http request 1 there will be a hidden input field that contains the token to be submited.
On http request 2 we will need to place this token value.
On http request 1, add a regular expression extractor with the following values.
Reference Name:TOKEN
Regular Expression:name=”TOKEN” value=”(.+?)”>
Template:$1$
Match No:1
Default Value: NOT FOUND
On http request 2 insert the token value into the paremeters section with the variable ${TOKEN}
Java – Byte Array to Hex String
Another Quick Reference Code Snippet
StringBuilder tempString = new StringBuilder(2 * bytes.length);
for (byte b : bytes) {
tempString.append("0123456789ABCDEF".charAt((b & 0xF0) >> 4));
tempString.append("0123456789ABCDEF".charAt((b & 0x0F)));
}
return tempString.toString();
Source:
http://stackoverflow.com/questions/5470219/java-get-md5-string-from-message-digest
Added Simple Enemy AI and Zombies
A quick video update of my game
Game Update
Slick2d Game Engine Animation Example
Using the Slick2d game engine there are multiple ways of creating animations.
The following examples will do the same exact thing, but its two different ways of writing it.
Imports
import org.newdawn.slick.Animation;
import org.newdawn.slick.SpriteSheet;
Example 1
SpriteSheet runningSS = new SpriteSheet("/path/to/sprite.png", 24, 32);
Animation runningAnimation = new Animation();
runningAnimation.setAutoUpdate(true);
runningAnimation.addFrame(runningSS.getSprite(0, 0), 100);
runningAnimation.addFrame(runningSS.getSprite(1, 0), 100);
runningAnimation.addFrame(runningSS.getSprite(2, 0), 100);
runningSS.getSprite(1, 0) is not the pixel value, but the sprite location if the whole image were broken up into cells based on the width and height defined when creating the sprite sheet
Example 2
SpriteSheet runningSS = new SpriteSheet("/path/to/sprite.png", 24, 32);
Animation runningAnimation = new Animation(runningSS, new int[]{0,0,1,0,2,0}, new int[]{100,100,100});
This example is for slick build 274
Run Maven with Ant
Run Maven with Ant
If you have the option to remove Ant from your projects its probably easier to just use maven for most of the build process, but sometimes it requires too much work and time, so this is a quick solution to have your Ant script run maven.
<exec executable="cmd">
<arg value="/c" />
<arg value="mvn package -e -f path/to/pom.xml " />
</exec>
Maven command to skip tests
-Dmaven.test.skip=true
Deploy to Local Maven Repository
Deploy Snapshot or release jar to Local Maven Repository
In Settings.xml
<settings>
<servers>
<server>
<id>releases</id>
<username>username</username>
<password>password</password>
</server>
</servers>
</settings>
In pom.xml
<distributionManagement>
<repository>
<id>releases</id>
<url>http://server/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://server/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
Copy Maven Dependencies to target folder
The following maven xml will retrieve all the maven dependencies and copy them to the target/lib folder.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>target/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
Add external jars to runnable jar MANIFEST.MF file using maven
Also package project as a runnable jar with the specified main class
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestEntries>
<Class-Path>lib/pojoxml-1.0.jar lib/lwjgl.jar lib/jorbis-0.0.15.jar lib/jogg-0.0.7.jar lib/natives-win32.jar lib/slick.jar</Class-Path>
</manifestEntries>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
<mainClass>com.porto.game.game2d.GameMain</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
Packaging External Jars with Maven
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>target/lib</outputDirectory>
<resources>
<resource>
<directory>lib</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
If filtering is set to true, Maven will parse the file using the encoding and rewrite it, I have found that his can cause all sorts of issues including class not found errors.
Collision Map and Render Image
I have updated the level collision detection code to support two images, one image (bottom) that is actually rendered to make up the level, and the second image (top) that tells the collision block creation code what type of collidable object to make.
In this case, anything transparent is non-collidable, anything black is solid and can’t be destroyed and anything red is collidable and can be destroyed.
Adventures into Game Development
So I have been playing around with game development for a while. First I had alot of trouble picking a game engine and a language. For a while, I was doing alot of webdesign with PHP and mySQL, which isn’t very similar to game development. Now I am currently working as a J2EE developer ( JAVA and JSPs). I first started out playing around with Unity Game Engine which is very nice, but I’m the type of person that likes to know how everything works. Unity does a great job at allowing you to focus on the game and its content rather then the engine and architecture of how the game works. I then decided that I would use jMonkey Engine and create a 3d space shooter type game. This was going well, but I felt I was spending more time tweaking physics settings and 3D modeling then actually coding the game.
Recently I decided I would give Slick2d ( http://slick.cokeandcode.com/ ) a try.
I am currently working on multiple aspects of this game, but the initial development was on creating levels. Slick2D supports levels created out of tiles that you can easily create with third party tools, but this only allows for very rigid levels. I decided that I wanted something more flexible. I finally decided that I wanted to be able to import a png image with transparent background. Anything opaque would be mapped as solid for the collision system. Below is the initial result.
Errors in the Wild
My Computer Setups
Portfolio – What’s On Campus
Online Auction Site for College Students
PHP/mySQL as well as AJAX for smooth operation
Created the Complete Design and Idea with 3 Partners
Made with Code Igniter

PHP/mySQL as well as AJAX for smooth operation
Created the Entire Design
Used by Temple University Web Development Team to manage updates and projects for the Fox School of Business and School of Tourism and Hospitality
Made with Code Igniter

PHP/mySQL as well as AJAX for smooth operation
Created the Entire Design
Used by Temple University to thank students
Made with Code Igniter

Portfolio – Horse Fare Products Inc.
Updating and PHP work
Upcoming Events PHP event list
mySQL server runs backend, with PHP admin pages
PHP and mySQL Student High School Voting System

Portfolio – Venetian Social Club
Complete Redesign
Website followed strict W3C standards
Website has now been changed by another party.












