mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-10-03 12:01:24 +08:00
Changed state fetch to return all states - allow client more control
This commit is contained in:
1 parent
85458c47b9
commit
0380e63899
2 files changed
+21
-23
No files matched your search
@@ -38,8 +38,17 @@ $(function () {
|
||||
|
||||
ctxCanvas.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
GarageServerIO.getPlayerStates(function (state) {
|
||||
ctxCanvas.fillRect(state.x, state.y, 15, 15);
|
||||
GarageServerIO.getStates(function (selfState, playerStates, entityStates) {
|
||||
|
||||
playerStates.forEach(function (player) {
|
||||
ctxCanvas.fillRect(player.currentState.x, player.currentState.y, 15, 15);
|
||||
});
|
||||
|
||||
entityStates.forEach(function (entity) {
|
||||
ctxCanvas.fillRect(entity.currentState.x, entity.currentState.y, 15, 15);
|
||||
});
|
||||
|
||||
ctxCanvas.fillRect(selfState.x, selfState.y, 15, 15);
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user