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); } }
public SBGameScene(bool addToFutileOnInit) : base("") { if (addToFutileOnInit) Futile.AddStage(this); finishedDrinks = new List<SBDrink>(); backgroundLayer = new SBBackgroundLayer(); AddChild(backgroundLayer); bar = new SBBar(); AddChild(bar); drinkers = new List<SBEntity>(); specialBarStools = new List<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.tag = 1; specialBarStool1.ProgressBarComponent().progressBar.isVisible = false; specialBarStool1.SittableComponent().isSpecial = true; specialBarStools.Add(specialBarStool1); AddChild(specialBarStool1); 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.tag = 2; specialBarStool2.ProgressBarComponent().progressBar.isVisible = false; specialBarStool2.SittableComponent().isSpecial = true; specialBarStools.Add(specialBarStool2); AddChild(specialBarStool2); drinker1 = new SBDrinker("player 1"); drinker1.tag = 1; drinker1.SpriteComponent(1).sprite.color = new Color(0.3f, 0.5f, 1.0f, 1.0f); drinker1.x = Futile.screen.halfWidth - 200f; drinker1.y = (Futile.screen.height - SBConfig.TOP_UI_HEIGHT) / 2f; drinker1.ProgressBarComponent().progressBar.isVisible = false; drinker1.ProgressBarComponent().progressBar.y += 45f; drinker1.DirectionComponent().FaceDirection(Direction.Left, true); //drinker1.SpriteComponent().sprite.color = new Color(0.3f, 0.5f, 1.0f, 1.0f); drinkers.Add(drinker1); AddChild(drinker1); drinker2 = new SBDrinker("player 2"); drinker2.tag = 2; drinker2.SpriteComponent(1).sprite.color = new Color(1.0f, 0.3f, 0.5f, 1.0f); drinker2.x = Futile.screen.halfWidth + 200f; drinker2.y = (Futile.screen.height - SBConfig.TOP_UI_HEIGHT) / 2f; drinker2.ProgressBarComponent().progressBar.isVisible = false; drinker2.ProgressBarComponent().progressBar.y += 45f; drinker2.DirectionComponent().FaceDirection(Direction.Right, true); //drinker2.SpriteComponent().sprite.color = new Color(1.0f, 0.3f, 0.5f, 1.0f); drinkers.Add(drinker2); AddChild(drinker2); hudLayer = new SBHudLayer(); drinker1.SignalFinishedDrink += hudLayer.HandleDrinkerFinishedDrink; drinker2.SignalFinishedDrink += hudLayer.HandleDrinkerFinishedDrink; drinker1.SignalFinishedDrink += HandleDrinkerFinishedDrink; drinker2.SignalFinishedDrink += HandleDrinkerFinishedDrink; drinker1.SignalBladderChanged += hudLayer.HandleBladderChanged; drinker2.SignalBladderChanged += hudLayer.HandleBladderChanged; drinker1.SignalPissedHimself += HandleDrinkerPissedHimself; drinker2.SignalPissedHimself += HandleDrinkerPissedHimself; AddChild(hudLayer); countdownLabel = new FLabel("Silkscreen", "3"); countdownLabel.color = Color.red; countdownLabel.x = Futile.screen.halfWidth; countdownLabel.y = (Futile.screen.height - SBConfig.TOP_UI_HEIGHT) / 2f; AddChild(countdownLabel); borderLayer = new SBBorderLayer(); AddChild(borderLayer); playAgain = new FLabel("Silkscreen", "play again"); playAgain.scale = 0.5f; playAgain.x = Futile.screen.halfWidth - 200f; playAgain.y = -175f; playAgain.color = Color.black; AddChild(playAgain); mainMenu = new FLabel("Silkscreen", "main menu"); mainMenu.scale = 0.5f; mainMenu.x = Futile.screen.halfWidth + 200f; mainMenu.y = -175f; mainMenu.color = Color.black; AddChild(mainMenu); #if ARCADE_VERSION playAgainButtons = new SBArcadeButtons(true); playAgainButtons.currentFlashingButton = 2; playAgainButtons.scale = 0.3f; playAgainButtons.x = playAgain.x - 90f; playAgainButtons.y = playAgain.y - 140f; AddChild(playAgainButtons); mainMenuButtons = new SBArcadeButtons(true); mainMenuButtons.currentFlashingButton = 5; mainMenuButtons.scale = 0.3f; mainMenuButtons.x = mainMenu.x - 90f; mainMenuButtons.y = mainMenu.y - 140f; AddChild(mainMenuButtons); #else playAgainLabel = new SBKeyCodeLabel("SPACE", Color.black, new Color(0.7f, 0, 0, 1.0f)); playAgainLabel.scale = 0.5f; playAgainLabel.x = playAgain.x - 75f; playAgainLabel.y = playAgain.y - 100f; AddChild(playAgainLabel); mainMenuLabel = new SBKeyCodeLabel("Q", Color.black, new Color(0.7f, 0, 0, 1.0f)); mainMenuLabel.scale = 0.5f; mainMenuLabel.x = mainMenu.x - 10f; mainMenuLabel.y = mainMenu.y - 100f; AddChild(mainMenuLabel); #endif /*tempLogLabel = new FLabel("Silkscreen", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); tempLogLabel.color = Color.black; tempLogLabel.x = 400f; tempLogLabel.y = Futile.screen.halfHeight; tempLogLabel.scale = 0.35f; AddChild(tempLogLabel);*/ }
private void InitBarStools() { barStools = new List<SBBarStool>(); //float barStoolMargin = 150f; /*for (int i = 0; i < 8; i++) { SBBarStool barStool = new SBBarStool(string.Format("barStool{0}", i), new Color(165f/255f, 115f/255f, 67f/255f)); if (i == 5 || i == 6 || i == 7) { barStool.ProgressBarComponent().progressBar.y -= 45f; } else barStool.ProgressBarComponent().progressBar.y += 45f; barStool.ProgressBarComponent().progressBar.isVisible = false; barStool.x = barStoolMargin * Mathf.Cos(i * 45 * Mathf.Deg2Rad); barStool.y = barStoolMargin * Mathf.Sin(i * 45 * Mathf.Deg2Rad); barStools.Add(barStool); AddChild(barStool); }*/ SBBarStool barStool = new SBBarStool(string.Format("barStool1"), new Color(0.3f, 0.5f, 1.0f, 1.0f)); barStool.ProgressBarComponent().progressBar.y += 45f; barStool.ProgressBarComponent().progressBar.isVisible = false; barStool.x = Futile.screen.width - 135f; barStool.y = 135f; barStool.tag = 1; barStools.Add(barStool); AddChild(barStool); barStool = new SBBarStool(string.Format("barStool2"), new Color(1.0f, 0.3f, 0.5f, 1.0f)); barStool.ProgressBarComponent().progressBar.y += 45f; barStool.ProgressBarComponent().progressBar.isVisible = false; barStool.x = 135f; barStool.y = 135f; barStool.tag = 2; barStools.Add(barStool); AddChild(barStool); }