I just started learning HTML5 canvas and Google App Engine's Channel API.
I build a simple game demo based on a isometric map. Right now I want to implement character movement, but I am wondering how I should implement it.
current demo: http://cheukalex.appspot.com
This is how I think it would be implemented:
The client will handle the movement. Once the arrow keys are pressed, the client will do the movement, then sends the new coordination to the server which then will be broadcast to other users on the server to update the location of your character.
Problems I thought of:
What if I want to implement "movement speed", as in how fast can the user walk five squares for example. The delay between each movement will be done on the client side. But will that be safe? since javascripts are easily edited.
How do I deal with latency? If i built a simple chase-tag game, how would I sync up the users so situations where, one person looks like they "tag" another user, but the other user see him 1-2 squares behind, wont happen?
EDIT: @nycynik, you are right, the latency is around 200ms. I have tested it here.
Latency Test: http://cheukalex.appspot.com/latency
Thats is the smallest latency it will ever get. 200ms is pretty fast. Then it might be my code that is slow?
How i implemented the whole game is.
Something wrong with this?
This was supposed to be a comment to the first answer, but it won't fit.
There might not be much you can do with the response time, because network latency will really be an issue for now. Perhaps you can just work on the user experience side. To make the delay "acceptable" to the user, why don't you add an animation?
For example, when the user hits an arrow key, the horse can look like it's pulling back slowly and getting ready to jump (behind the scenes you're sending a request through the Channel API). When you get the response from the server, the horse can then complete the jump and land on another position.
Though there will still be an issue of latency, your users might find it "acceptable" if the latency isn't that obvious.