Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Player
- * @param string Session ID
- * @param int Default X coordinates
- * @param int Default Y coordinates
- * @param string Default Color
- * @constructor
- */
- function Player(id, default_x, default_y, default_color) {
- this.name = null;
- this.element = null;
- this.id = id;
- this.dom = null;
- this.default_x = default_x;
- this.default_y = default_y;
- this.default_color = default_color;;
- this.element = '<div class="player" id="'+this.id+'">';
- };
- /**
- * initialize
- * Loads a player onto the screen
- * @return
- */
- Player.prototype.initialize = function() {
- this.dom = $('#'+this.id).css({
- 'left': this.default_x,
- 'top' : this.default_y,
- 'backgroundColor': this.default_color
- });
- console.log(this.dom.css('backgroundColor'));
- };
- // Sometimes, console.log(this.dom.css('backgroundColor')); is transparent and I don't know why.
Add Comment
Please, Sign In to add comment