I have still not had the time to place all the links to the code samples on this page. There are many more samples on the Assignments page.


I have been building a FPS gaming engine using Java to use as a sample for students to learn from. Make sure you check it out (FPS370).


Here are the samples from the network lecture last night.

net1.zip This shows a simple server and client. The client passes integers to the server. Single connection per run.
net2.zip Server allows multiple connections.
net3.zip Server allows multiple simultanous reads and writes by using a communication thread per connection.
net4.zip Introduction of a message passing system.
net5.zip The sheep race sample game. Look at the README.doc file for instructions on building and running this game. The server code was updated with message queues so reads and writes of messages are handled as background threads.

Noah and I were discussing problems with loading models with textures. Here (SF-Loader.zip) is the sample using the StarFire model loader.


I modified the FPS sample and added mouse movement. I also change the keyboard to be closer to the standar FPS pc game. I purposefully avoided any of the standard Java mouse behavior and handled movement at a much lower level to give you the most control in your own games. I forced the mouse to stay in the center of the screen. This is also common in non-java apps, but the mouse should be hidden. It is a simple thing to do and I'll leave that up to you to either implement or ask how.

Controls for movement are: Turn

left/right arrows
mouse left/right

  Move Forward/Back W/S
  Strafe Left/Right A/D
  Look up/Down up/down arrows
mouse forward/back
Quit   Esc


I created a sample to show keyboard movement in a FPS game. It uses a map created with the Teder application we used for some of the 2D games. The next step is to add mouse control.

Controls for movement are: Turn left/right arrows
  Forward/Back up/down arrows
  Strafe Left/Right A/D


Added a sample that shows how to implement yaw, pitch and roll movement. There is a decent comment at the top of the Tmpl3Panel.java file that describes the functionality. Basically you have to base the movement on your current orientation. For pitch, you take a vector along the x axis (1,0,0) and transform it with the current orientation transformation matrix. Use that to create an AxisAngle with a rotation in the direction you want (forward or backward pitch) and use that to create another transformation. Then multiply your orientation transformation (t3dYPR) by that transformation and that adds the pitch.

Controls for movement are: Yaw left/right
  Pitch A/D
  Roll W/S

I added a sample for picking. Point the pick ray at a cube and push space. The cube moves away from the view. The same controls as the other sample. Space moves the closest cube in the pick path.

CPSC370 - Games Development
Chapman University
Instructor: W. Wood Harter
(c) copyright 2006 - W. Wood Harter - All Rights Reserved
Screen shots on banner (c) copyright their resprective owners