Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- class Game{
- constructor(context){
- this.context = context;
- this.gameUpdate;
- this.updatePerSecond = 10;
- }
- initiate(){
- this.gameUpdate = setInterval(this.update, 1000 / this.updatePerSecond);
- window.requestAnimationFrame(this.draw);
- }
- update(){
- }
- draw(){
- window.requestAnimationFrame(this.draw);
- }
- }
- var game = new Game('123');
- game.initiate();
Add Comment
Please, Sign In to add comment