Guest User

Untitled

a guest
Jan 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. 'use strict';
  2. class Game{
  3. constructor(context){
  4. this.context = context;
  5. this.gameUpdate;
  6. this.updatePerSecond = 10;
  7. }
  8.  
  9. initiate(){
  10. this.gameUpdate = setInterval(this.update, 1000 / this.updatePerSecond);
  11. window.requestAnimationFrame(this.draw);
  12. }
  13.  
  14. update(){
  15. }
  16.  
  17. draw(){
  18. window.requestAnimationFrame(this.draw);
  19. }
  20. }
  21. var game = new Game('123');
  22. game.initiate();
Add Comment
Please, Sign In to add comment