var Dealer = function(deck){ PIXI.DisplayObjectContainer.call(this); this.deck = deck; this.cards = []; this.dealerBG = this.addChild(new PIXI.Sprite.fromImage(config.stageImages.dealerBG)); this.dealerBG.anchor = new PIXI.Point(0, 0.5); this.dealerBG.x = 40; this.dealerBG.y = 339; this.x = this.hiddenX = -400; };
var QuestionHolder = function(){ PIXI.DisplayObjectContainer.call(this); this.background = this.addChild(new PIXI.Sprite.fromImage(config.stageImages.playerBG)); this.background.scale.y = -1; this.background.anchor = new PIXI.Point(1, 0.5); this.background.x = config.canvas.width - 40; this.background.y = 711; this.text = this.addChild(new PIXI.Text("Do you want to gamble some credits?", {"fill":"white"})); this.text.anchor = new PIXI.Point(0.5, 0.5); this.text.x = 620; this.text.y = 585; this.buttons = { yes : this.addChild(new Button(config.buttons.yes)), no : this.addChild(new Button(config.buttons.no)), }; this.y = this.hiddenY = 200; };
var Card = function(cardData){ PIXI.DisplayObjectContainer.call(this); this.cardData = cardData; this.face = this.addChild(PIXI.Sprite.fromImage(cardData.picture)); this.face.anchor = new PIXI.Point(0.5, 0.5); this.face.alpha = 0; this.face.scale.x = -1; this.face.scale.y = -1; this.face.x = this.face.texture.width/2; this.face.y = this.face.texture.height/2; this.back = this.addChild(PIXI.Sprite.fromImage(config.deck.backTextures)); this.back.anchor = new PIXI.Point(0.5, 0.5); this.back.alpha = 1; this.back.scale.x = -1; this.back.x = this.back.texture.width/2; this.back.y = this.back.texture.height/2; this.x = config.deck.pilePosition.x; this.y = config.deck.pilePosition.y; };
var Player = function(deck){ PIXI.DisplayObjectContainer.call(this); this.deck = deck; this.cards = []; this.playerBG = this.addChild(new PIXI.Sprite.fromImage(config.stageImages.playerBG)); this.playerBG.anchor = new PIXI.Point(1.0, 0.5); this.playerBG.x = config.canvas.width - 40; this.playerBG.y = 374; this.buttons = { double : this.addChild(new Button(config.buttons.double)), half : this.addChild(new Button(config.buttons.half)), }; this.x = this.hiddenX = config.canvas.width; this.collectMotionData = Object.create(config.deck.pilePosition); this.collectMotionData.x += 1; this.collectMotionData.y += 1; };