Advertisement
Guest User

ready button class

a guest
Nov 16th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ready = function(game) {
  2.     this.game = game;
  3. };
  4.  
  5. ready.prototype = {
  6.    
  7.     preload: function() {
  8.         game.load.image("readyButton", "assets/readyButton.png");
  9.     },
  10.  
  11.     create: function() {
  12.         this.readyButton = game.add.button(game.world.centerX, game.world.centerY, "readyButton", this.isReady(), this);
  13.         this.readyButton.anchor.setTo(0.5, 0.5);
  14.         this.readyButton.inputEnabled = true;
  15.     },
  16.  
  17.     update: function() {
  18.         this.buttonActive();
  19.     },
  20.  
  21.     isReady: function() {
  22.         if(this.readyButt)
  23.             game.global.ready = true;
  24.     }
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement