My current game app runs very smoothly. You drive the “cube/avatar” and turn right or left, forwards or
backwards. As long as a kep is pressed, you are moving, multiple key combinations give you combined
movement. ie; up arrow and left arrow = move forward whil turning to the left, and so on. You get the picture.
I have a KeyTypedBehavior and MovementBehavior(both extend Behavior)
The KeyTypedBehavior WakesUpOn keypressed, and the Movement WakesUpOn frames elapsed(0).
Space bar fires a single projectile by capturing the current transform of the “cube/avatar”
and applying it to a new object(smaller cube) then move it forward for x number of seconds
then remove it frm the scene.
Ignoring some collisions issues with walls(which I am not concerned with right now), it runs exaclty
like I want it to.
At what point in that scenario should I send data from the client to the server?
Should I send x,y,z, and the matrix[16] of the player to the server or do you think keypresses = send(“turn left”), send(“turn right”)
would suffice?
considering you could be turning left and moving forward. Will this keep it accurate enough for shooting at
another player? An “arena” will have a max of 16 players. Right now only one arena will be active at
any one time.
And yes Quake-like movement is fine, I use keyboard only. Arrows for movement, possibly the shift to
boost speed, “tab” or “space” for fire and “alt” to activate shields.
I have done this in a 2D realm sending int’s for x and y and double angle to server using a thread that sends the data 3-4 times a second
and the server is on a 30 ms loop sending all data to all players(with a little, very primitive dead r).
http://www22.brinkster.com/mbowles/ for the 3D source code. Once unzipped, nav to folder and type java AWTFrame
You will notice a lot of the code is J3D tutorial(thanks Justin)
and many, many thaks to those of you here.