Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. // logic for the Count game
  2.  
  3. class Game{
  4. constructor() {
  5. console.log(`Welcome to the game. Version ${this.version()}`);
  6.  
  7. this.canvas = document.getElementById("game-canvas");
  8. this.stage = new createjs.Stage(this.canvas);
  9.  
  10. createjs.Ticker.setFPS(60);
  11.  
  12. // keep re-drawing the stage.
  13. createjs.Ticker.on("tick", this.stage);
  14.  
  15. // testing code
  16. var circle = new createjs.Shape();
  17. circle.graphics.beginFill("gold").drawCircle(0,0,40);
  18. circle.x = circle.y = 100;
  19. this.stage.addChild(circle);
  20. }
  21. version(){
  22. return '1.0.0';
  23. }
  24. }
  25.  
  26. // start the game
  27. var game = new Game();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement