Object controller help

Been trying to think of a way to handle objects. It just simple cube moving around the terrain map. I am working on the server code stuff that handle input from the user.



Here is what I am trying to say.

When client receive message and then convert into inputs or actions in the server. If one of the variables is true for controlling the movement. Check for updates.



Not sure if it the action listener or the controller stuff. Not sure how to code it. Trying my best not to used looping.



Example:





function update(){

  for(CustomPlayer player :players){

      player.update();

  }

}

You can set a Control on a Spatial to be updated. See the class "Control" and the method Spatial.addControl().