Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // po stronie serwera
- const game = new Game(io);
- setInterval((time: number) => {
- game.run(time);
- });
- // po stronie clienta
- function ticker(action: FrameRequestCallback) {
- window.requestAnimationFrame((time) => {
- ticker(action);
- action(time);
- });
- }
- const game = new Game(socket);
- ticker(() => {
- game.run();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement