public SBHudLayer() { FSprite background = WTSquareMaker.Square(Futile.screen.width, SBConfig.TOP_UI_HEIGHT); background.anchorX = 0; background.anchorY = 1; background.x = 0; background.y = Futile.screen.height; background.color = new Color(0.32f, 0.32f, 0.32f, 1.0f); AddChild(background); float width = 627f; float alpha = 0.5f; FSprite blue = WTSquareMaker.Square(width, SBConfig.TOP_UI_HEIGHT); blue.alpha = alpha; blue.anchorX = 0; blue.anchorY = 1; blue.x = 0; blue.y = Futile.screen.height; blue.color = new Color(0.3f, 0.5f, 1.0f, 1.0f); AddChild(blue); FSprite red = WTSquareMaker.Square(width, SBConfig.TOP_UI_HEIGHT); red.alpha = alpha; red.anchorX = 1; red.anchorY = 1; red.x = Futile.screen.width; red.y = Futile.screen.height; red.color = new Color(1.0f, 0.3f, 0.5f, 1.0f); AddChild(red); FLabel superBlackout = new FLabel("Silkscreen", "Super Blackout!"); superBlackout.scale = 0.6f; superBlackout.x = Futile.screen.halfWidth; superBlackout.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT / 2f + 4f; AddChild(superBlackout); /*drinkCountLabel1.scale = drinkCountLabel2.scale = 0.75f; drinkCountLabel1 = new FLabel("Silkscreen", "Drinks: 0"); drinkCountLabel2 = new FLabel("Silkscreen", "Drinks: 0"); drinkCountLabel1.anchorX = 0; drinkCountLabel2.anchorX = 1; drinkCountLabel1.x = xPadding; drinkCountLabel2.x = Futile.screen.width - xPadding - extraRightSideXPadding; drinkCountLabel1.y = drinkCountLabel2.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT / 2f + yPadding; drinkCountLabel1.color = new Color(0.3f, 0.5f, 1.0f, 1.0f); drinkCountLabel2.color = new Color(1.0f, 0.3f, 0.5f, 1.0f); AddChild(drinkCountLabel1); AddChild(drinkCountLabel2);*/ float xPadding = 12f; //float extraRightSideXPadding = 10f; //float yPadding = 4f; //float bladderBarEdgeThickness = 8f; drinkCounter1 = new SBDrinkCounter(SBConfig.DRINKS_TO_WIN); drinkCounter2 = new SBDrinkCounter(SBConfig.DRINKS_TO_WIN); drinkCounter1.x = xPadding; drinkCounter2.x = Futile.screen.width - xPadding - drinkCounter2.GetWidth(); drinkCounter1.y = drinkCounter2.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT / 2f; bladderBar1 = new SBBladderBar(1); bladderBar2 = new SBBladderBar(2); bladderBar1.x = Futile.screen.halfWidth - 450f; bladderBar2.x = Futile.screen.halfWidth + 450f; bladderBar1.y = bladderBar2.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT / 2f; AddChild(bladderBar1); AddChild(bladderBar2); AddChild(drinkCounter1); AddChild(drinkCounter2); }
public void SetupPage(int pageNum) { //currentPageIsFullySetup = false; drinker1.scale = 1; drinker2.scale = 1; if (pageNum == 0) { drinker1.x = Futile.screen.width * 1f/3f; drinker1.y = Futile.screen.halfHeight + 50f; drinker2.x = Futile.screen.width * 2f/3f; drinker2.y = Futile.screen.halfHeight + 50f; FLabel label1 = new FLabel("Silkscreen", "This is\nPlayer 1"); label1.x = drinker1.x; label1.y = drinker1.y - 100f; label1.color = drinker1.SpriteComponent(1).sprite.color; label1.scale = 0.5f; FLabel label2 = new FLabel("Silkscreen", "This is\nPlayer 2"); label2.x = drinker2.x; label2.y = drinker2.y - 100f; label2.color = drinker2.SpriteComponent(1).sprite.color; label2.scale = 0.5f; ShowNodes(new FNode[] {drinker1, label1, drinker2, label2}, 0.6f, 0.3f); } if (pageNum == 1) { drinker1.y = Futile.screen.halfHeight + 200f; drinker2.y = Futile.screen.halfHeight + 200f; drinker1.SpriteComponent(1).StartAnimation(WTMain.animationManager.AnimationForName("drinkerWalk")); drinker2.SpriteComponent(1).StartAnimation(WTMain.animationManager.AnimationForName("drinkerWalk")); #if ARCADE_VERSION SBArcadeButtons ab1 = new SBArcadeButtons(true); ab1.joystickIsRotating = true; ab1.x = drinker1.x - 75f; ab1.y = drinker1.y - 70f; ab1.scale = 0.3f; SBArcadeButtons ab2 = new SBArcadeButtons(true); ab2.joystickIsRotating = true; ab2.x = drinker2.x - 75f; ab2.y = drinker2.y - 70f; ab2.scale = 0.3f; #else SBKeyCodeLabel kcl1 = new SBKeyCodeLabel("WASD", Color.black, new Color(0.3f, 0, 0, 1.0f)); kcl1.x = drinker1.x - 75f; kcl1.y = drinker1.y - 70f; kcl1.scale = 0.5f; SBKeyCodeLabel kcl2 = new SBKeyCodeLabel("ARROW KEYS", Color.black, new Color(0.3f, 0, 0, 1.0f)); kcl2.x = drinker2.x - 125f; kcl2.y = drinker2.y - 70f; kcl2.scale = 0.5f; #endif #if ARCADE_VERSION FLabel text = new FLabel("Silkscreen", "Use the joystick to walk.\nThe more you drink, the harder it is!"); #else FLabel text = new FLabel("Silkscreen", "Player 1 movement: WASD\nPlayer 2 movement: ARROW KEYS\nThe more you drink, the harder it is!"); #endif text.scale = 0.8f; text.color = Color.black; text.anchorY = 1; text.x = Futile.screen.halfWidth; text.y = Futile.screen.halfHeight - 50f; #if ARCADE_VERSION ShowNodes(new FNode[] {drinker1, ab1, drinker2, ab2, text}, 0.5f, 0.25f); #else ShowNodes(new FNode[] {drinker1, kcl1, drinker2, kcl2, text}, 0.5f, 0.25f); #endif } if (pageNum == 2) { SBBar bar = new SBBar(); FLabel text = new FLabel("Silkscreen", "Get a drink at your bar,\nthen drink it at your barstool"); text.scale = 0.8f; text.color = Color.black; text.anchorY = 1; text.x = Futile.screen.halfWidth; text.y = Futile.screen.halfHeight + 100f; SBBarStool specialBarStool1 = new SBBarStool("special bar stool 1", new Color(0.3f, 0.5f, 1.0f, 1.0f)); specialBarStool1.x = 100f; specialBarStool1.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT - 100f; specialBarStool1.ProgressBarComponent().progressBar.isVisible = false; SBBarStool specialBarStool2 = new SBBarStool("special bar stool 2", new Color(1.0f, 0.3f, 0.5f, 1.0f)); specialBarStool2.x = Futile.screen.width - 100f; specialBarStool2.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT - 100f; specialBarStool2.ProgressBarComponent().progressBar.isVisible = false; float xAmt = 190f; float yAmt = 220f; FSprite drinkHere1 = new FSprite("drinkHere1.psd"); drinkHere1.color = new Color(0.3f, 0.5f, 1.0f, 1.0f); drinkHere1.anchorX = 0; drinkHere1.x = xAmt; drinkHere1.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT - yAmt; FSprite arrow1 = new FSprite("arrow.psd"); arrow1.alpha = drinkHere1.alpha; arrow1.color = drinkHere1.color; arrow1.anchorX = 1; arrow1.anchorY = 0; arrow1.x = drinkHere1.x - 10f; arrow1.y = drinkHere1.y - 5f; FSprite drinkHere2 = new FSprite("drinkHere2.psd"); drinkHere2.color = new Color(1.0f, 0.3f, 0.5f, 1.0f); drinkHere2.anchorX = 1; drinkHere2.x = Futile.screen.width - xAmt; drinkHere2.y = Futile.screen.height - SBConfig.TOP_UI_HEIGHT - yAmt; FSprite arrow2 = new FSprite("arrow.psd"); arrow2.scaleX = -1; arrow2.alpha = drinkHere2.alpha; arrow2.color = drinkHere2.color; arrow2.anchorX = 1; arrow2.anchorY = 0; arrow2.x = drinkHere2.x + 10f; arrow2.y = drinkHere2.y - 5f; xAmt = 223f; yAmt = 285f; FSprite getDrinkHere1 = new FSprite("getDrinkHere1.psd"); getDrinkHere1.color = new Color(0.3f, 0.5f, 1.0f, 1.0f); getDrinkHere1.anchorX = 1; getDrinkHere1.x = Futile.screen.width - xAmt; getDrinkHere1.y = yAmt; FSprite getArrow1 = new FSprite("arrow.psd"); getArrow1.scale = -1; getArrow1.alpha = getDrinkHere1.alpha; getArrow1.color = getDrinkHere1.color; getArrow1.anchorX = 1; getArrow1.anchorY = 0; getArrow1.x = getDrinkHere1.x + 10f; getArrow1.y = getDrinkHere1.y - 5f; FSprite getDrinkHere2 = new FSprite("getDrinkHere2.psd"); getDrinkHere2.color = new Color(1.0f, 0.3f, 0.5f, 1.0f); getDrinkHere2.anchorX = 0; getDrinkHere2.x = xAmt; getDrinkHere2.y = yAmt; FSprite getArrow2 = new FSprite("arrow.psd"); getArrow2.scaleY = -1; getArrow2.alpha = getDrinkHere2.alpha; getArrow2.color = getDrinkHere2.color; getArrow2.anchorX = 1; getArrow2.anchorY = 0; getArrow2.x = getDrinkHere2.x - 10f; getArrow2.y = getDrinkHere2.y - 5f; ShowNodes(new FNode[] {specialBarStool1, specialBarStool2, drinkHere1, drinkHere2, getDrinkHere1, getDrinkHere2, arrow1, arrow2, getArrow1, getArrow2, bar, text}, 0.25f, 0.125f); } if (pageNum == 3) { SBDrink drink = new SBDrink("drink"); drink.x = Futile.screen.halfWidth; drink.y = Futile.screen.halfHeight + 200f; drink.Spill(); drinker1.y = Futile.screen.halfHeight + 200f; drinker2.y = Futile.screen.halfHeight + 200f; drinker1.SpriteComponent(1).StartAnimation(WTMain.animationManager.AnimationForName("drinkerWalk")); drinker2.SpriteComponent(1).StartAnimation(WTMain.animationManager.AnimationForName("drinkerWalk")); #if ARCADE_VERSION SBArcadeButtons ab1 = new SBArcadeButtons(true); ab1.currentFlashingButton = 6; ab1.x = drinker1.x - 75f; ab1.y = drinker1.y - 70f; ab1.scale = 0.3f; SBArcadeButtons ab2 = new SBArcadeButtons(true); ab2.currentFlashingButton = 6; ab2.x = drinker2.x - 75f; ab2.y = drinker2.y - 70f; ab2.scale = 0.3f; #else SBKeyCodeLabel kcl1 = new SBKeyCodeLabel("LEFT\nSHIFT", Color.black, new Color(0.3f, 0, 0, 1.0f)); kcl1.x = drinker1.x - 75f; kcl1.y = drinker1.y - 70f; kcl1.scale = 0.5f; SBKeyCodeLabel kcl2 = new SBKeyCodeLabel("M", Color.black, new Color(0.3f, 0, 0, 1.0f)); kcl2.x = drinker2.x - 15f; kcl2.y = drinker2.y - 70f; kcl2.scale = 0.5f; #endif FLabel punch = new FLabel("Silkscreen", "Punch each other\nto spill drinks!"); punch.anchorY = 0; punch.color = Color.black; punch.scale = 0.8f; punch.x = Futile.screen.halfWidth; punch.y = Futile.screen.halfHeight - 150f; #if ARCADE_VERSION ShowNodes(new FNode[] {drinker1, ab1, drinker2, ab2, drink, punch}, 0.5f, 0.25f); #else ShowNodes(new FNode[] {drinker1, kcl1, drinker2, kcl2, drink, punch}, 0.5f, 0.25f); #endif } if (pageNum == 4) { dc1 = new SBDrinkCounter(7); dc1.x = Futile.screen.halfWidth - dc1.GetWidth() / 2f - 325f; dc1.y = Futile.screen.halfHeight + 320f; dc2 = new SBDrinkCounter(7); dc2.x = Futile.screen.halfWidth - dc2.GetWidth() / 2f + 325f; dc2.y = Futile.screen.halfHeight + 320f; drinker1.y = Futile.screen.halfHeight + 150f; drinker2.y = Futile.screen.halfHeight + 150f; drinker1.SpriteComponent(1).StartAnimation(WTMain.animationManager.AnimationForName("drinkerPassOut")); drinker2.SpriteComponent(1).StartAnimation(WTMain.animationManager.AnimationForName("drinkerPassOut")); FLabel text = new FLabel("Silkscreen", "First one to 7 drinks\npasses out and wins!"); text.scale = 0.8f; text.color = Color.black; text.anchorY = 1; text.x = Futile.screen.halfWidth; text.y = Futile.screen.halfHeight - 50f; ShowNodes(new FNode[] {drinker1, drinker2, dc1, dc2, text}, 0.5f, 0.25f); } if (pageNum == 5) { FSprite bathroom = new FSprite("bathroomTop.psd"); bathroom.x = Futile.screen.halfWidth; bathroom.y = drinker1.y; drinker1.SpriteComponent(0).sprite.isVisible = true; drinker2.SpriteComponent(0).sprite.isVisible = true; drinker1.SpriteComponent(0).StartAnimation(WTMain.animationManager.AnimationForName("pee")); drinker2.SpriteComponent(0).StartAnimation(WTMain.animationManager.AnimationForName("pee")); FLabel pee = new FLabel("Silkscreen", "But make sure you\ngo to the bathroom before\nyou piss yourself!"); pee.anchorY = 0; pee.color = Color.black; pee.scale = 0.8f; pee.x = Futile.screen.halfWidth; pee.y = Futile.screen.halfHeight - 175f; ShowNodes(new FNode[] {drinker1, drinker2, bathroom, pee}, 0.5f, 0.25f); } if (pageNum == 6) { WTMain.SwitchToScene(SceneType.TitleScene); } }