public InGamePage() { FSprite bg = new FSprite("Atlases/bg"); bg.width = Futile.screen.width; bg.height = Futile.screen.height; AddChild(bg); hudStuff = new FLabel("Minecraftia", "Energy:"); hudShadow = new FLabel("Minecraftia", "Energy:"); hudStuff.scale = 0.7f; hudShadow.scale = 0.7f; hudShadow.color = Color.black; hudStuff.SetPosition(new Vector2(0 , (Futile.screen.height/2)*0.9f)); hudShadow.SetPosition(new Vector2( 1f, ((Futile.screen.height / 2) * 0.9f - 1))); gameArea = new FContainer(); enemies = new List<Entity>(); projectiles = new List<Entity>(); Enemyprojectiles = new List<Entity>(); entityContainer = new FContainer(); projectileContainer = new FContainer(); particleContainer = new FContainer(); gameArea.AddChild(particleContainer); particleContainer.AddChild(projectilesParticles = new FParticleSystem(300)); gameArea.AddChild(entityContainer); gameArea.AddChild(projectileContainer); AddChild(gameArea); InGamePage.CurrentInGamePage = this; ListenForUpdate(Update); jugador = new Player(); GenerateFoe(); AddChild(hudShadow); AddChild(hudStuff); }
public MonklandUI(FStage stage) { displayMessages = new List <QuickDisplayMessage>(); uiLabels = new List <FLabel>(); worldStage = stage; uiContainer = new FContainer(); string text = "Monkland " + Monkland.VERSION; if (!MonklandSteamManager.DEBUG) { text = ""; } statusLabel = new FLabel("font", text); statusLabel.alignment = FLabelAlignment.Left; statusLabel.SetPosition(50.01f, Futile.screen.height - 49.99f); uiContainer.AddChild(statusLabel); for (int i = 0; i < 200; i++) { FLabel displayLabel = new FLabel("font", ""); displayLabel.alignment = FLabelAlignment.Left; uiContainer.AddChild(displayLabel); uiLabels.Add(displayLabel); } displayMessages.Clear(); stage.AddChild(uiContainer); }
public override void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); string backButtonText = "Back"; string titleText = "About The Game"; if (Main.instance.gameFinished){ // Display end game messages titleText = "The Ship Went Nuclear!"; _scoreLabel = new FLabel("Emulogic", "You Saved " + Main.instance.crewSaved + " Crew Members"); _scoreLabel.color = Color.black; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _scoreLabel.scale = 0.25f; _scoreLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight / 2); AddChild(_scoreLabel); _againButton = new FButton("buttonWide"); _againButton.AddLabel("Emulogic","Play Again",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _againButton.label.scale = 0.25f; _againButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + 80); AddChild(_againButton); _againButton.SignalRelease += HandleAgainButtonRelease; backButtonText = "Home"; } else { // diplay generic message } _textLabel = new FLabel("Emulogic", titleText); _textLabel.color = Color.black; _textLabel.scale = 0.5f; _textLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight * 2 / 3); AddChild(_textLabel); _quitButton = new FButton("buttonWide"); _quitButton.AddLabel("Emulogic",backButtonText,Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _quitButton.label.scale = 0.25f; _quitButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight); AddChild(_quitButton); _quitButton.SignalRelease += HandleQuitButtonRelease; string about = "Game Designed and created by Jason Rendel,\nfor Ludum Dare 27. My first game jam ever!\nCreated for the 48 hour competition.\n\n ---- Tools ----\n Unity 3d - Futile - Gimp \nTexture Packer - Glyph Designer - CFXR\n\nFollow me @jasonrendel\nCheck out what else I'm up to at www.jasonrendel.com"; _scoreLabel = new FLabel("Emulogic", about); _scoreLabel.color = Color.black; _scoreLabel.scale = 0.20f; _scoreLabel.SetPosition(Futile.screen.halfWidth, 200); AddChild(_scoreLabel); }
public ItemContainerVisualizer(MenuFlow menu, ItemContainer itemContainer) : base(menu) { _itemContainer = itemContainer; _itemAmount = new FLabel("font", string.Empty); _itemAmount.SetPosition(new Vector2(4f, -4f)); itemContainer.SignalItemChange += OnItemChanged; }
public override void Update(float deltaTime) { Vector2 anchorPosition = player.screenPosition + Vector2.up * 16f; float scrollDelta = Input.mouseScrollDelta.y; _sleepTime = scrollDelta != 0 ? 1f : _sleepTime - deltaTime; _factor = Mathf.Clamp01(_factor + (_sleepTime > 0f ? deltaTime : -deltaTime) * 5f); if (!(_factor > 0f)) { Terminate(); } _scrollAmount += scrollDelta; int oldSelectedIndex = _selectedIndex; _selectedIndex = (int)Mathf.Repeat(-_scrollAmount, Length); _selectSpriteAngle = Mathf.LerpAngle(_selectSpriteAngle, (float)_selectedIndex / Length * 360f - 90f, deltaTime * 10f); for (int index = 0; index < Length; index++) { bool selected = index == _selectedIndex; float radian = ((float)index / Length - _selectSpriteAngle / 360f) * Mathf.PI * 2f; _visualizer[index].position = anchorPosition + (new Vector2(Mathf.Cos(radian), Mathf.Sin(radian)) * _factor * (selected ? 40f : 32f)); _visualizer[index].scale = Vector2.Lerp(_visualizer[index].scale, Vector2.one * (selected ? 2f : 1f), deltaTime * 10f); _visualizer[index].container.alpha = _factor; } ItemContainer pickedItemContainer = player.inventory[_selectedIndex]; if (pickedItemContainer.blank) { _selectedItemLabel.text = string.Empty; } else { _selectedItemLabel.text = pickedItemContainer.itemStack.item.name; } _selectedItemLabelShadow.text = _selectedItemLabel.text; _selectedItemLabel.SetPosition(anchorPosition + new Vector2(0f, 24f)); _selectedItemLabelShadow.SetPosition(anchorPosition + new Vector2(0f, 23f)); _selectedItemLabel.alpha = _factor; _selectedItemLabelShadow.alpha = _factor; if (oldSelectedIndex != _selectedIndex) { player.PickItem(pickedItemContainer); } base.Update(deltaTime); }
public virtual void Update() { timeLabel.MoveToFront(); labelShadow.MoveToFront(); label.MoveToFront(); labelShadow.text = label.text; labelShadow.SetPosition(label.GetPosition() + new Vector2(1, -1)); if (update) { percentage -= UnityEngine.Time.deltaTime * .1f; } if (Mathf.CeilToInt(percentage * 10) != lastSecond) { lastSecond = Mathf.CeilToInt(percentage * 10); timeLabel.text = "" + lastSecond; this.scale = tickScale; if (tickSound) { if (lastSecond <= 3) { FSoundManager.PlaySound("countdownUrgent", .9f); } else { FSoundManager.PlaySound("countdown", .8f); } } } else { if (this.scale >= normalScale) { this.scale -= UnityEngine.Time.deltaTime * (tickScale - normalScale); } } timeLabel.scale = this.scale; if (this.percentage < .3f) { this.color = new Color(percentage * 3, 0, 0); } else if (this.percentage < .5f) { this.color = new Color(percentage * 2, percentage * 2, 0); } else { this.color = new Color(1.0f - percentage, percentage * 2, 0); } clockBackground.scale = this.scale; }
public IsometricLoopFlowManager() : base() { _fadeSprite = new FSprite("pixel"); _fadeSprite.scaleX = MenuFlow.screenWidth; _fadeSprite.scaleY = MenuFlow.screenHeight; _fadeSprite.color = Color.black; _fadeLabel = new FLabel("font", "Loading..."); _fadeLabel.alignment = FLabelAlignment.Right; _fadeLabel.SetPosition(MenuFlow.rightDown + new Vector2(-10f, 10f)); }
public void Update() { this.alpha = 1 - (float)(count / aliveTime); this.y -= upSpeed * UnityEngine.Time.deltaTime; count += UnityEngine.Time.deltaTime; if (count >= aliveTime) { this.RemoveFromContainer(); } shadow.SetPosition(GetPosition() + new Vector2(1.0f, -1.0f)); shadow.alpha = this.alpha; }
override public void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; Main.instance.crewSaved = 0; FSprite background = new FSprite("mainGameViewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _levelManager = new LevelManager(); AddChild(_levelManager); this.shouldSortByZ = true; meltdownBar = new FSprite("meltdown"); meltdownBar.SetPosition(Futile.screen.halfWidth, 672); AddChild(meltdownBar); _closeButton = new FButton("button"); _closeButton.AddLabel("Emulogic", "Quit", Color.black); _closeButton.label.scale = 0.25f; _closeButton.sortZ = 1; _closeButton.SignalRelease += HandleCloseButtonRelease; _closeButton.x = Futile.screen.width - 125.0f; _closeButton.y = Futile.screen.height - 75.0f; AddChild(_closeButton); Clock clock = new Clock(); clock.SetPosition(75.0f, Futile.screen.height - 75.0f); AddChild(clock); crewSavedLabel = new FLabel("Emulogic", "Crew Members Saved: 0"); crewSavedLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.height - 45.0f); crewSavedLabel.scale = 0.25f; AddChild(crewSavedLabel); selectedInventory = new FSprite("inventorySelected"); selectedInventory.isVisible = false; AddChild(selectedInventory); //spawnInventory(); spawnCrew(2); _lastCycle = Main.GameTime; }
public GamePage() { Debug.Log("In game page"); hudStuff = new FLabel("font", "Game Stats:"); hudShadow = new FLabel("font", "Game Stats:"); hudStuff.SetPosition(new Vector2(Futile.screen.halfWidth / 4, Futile.screen.height - 40)); hudShadow.SetPosition(new Vector2((Futile.screen.halfWidth / 4)+1f, (Futile.screen.height - 41))); hudStuff.scale = 0.3f; hudStuff.color = Color.white; hudShadow.scale = 0.3f; hudShadow.color = Color.black; }
public Clock() : base("clock", true, 0, 1.0f) { label = new FLabel("Large", "Time Left"); timeLabel = new FLabel("Small", "10"); timeLabel.color = Color.black; x = Futile.screen.halfWidth - width * tickScale / 2 - clockMargin; y = Futile.screen.halfHeight - height * tickScale / 2 - clockMargin; timeLabel.SetPosition(this.GetPosition()); this.scale = normalScale; clockBackground = new FSprite("clock"); clockBackground.SetPosition(GetPosition()); label.x = x; label.y = y + height / 3 * tickScale / 2; labelShadow = new FLabel("Large", "Time Left"); labelShadow.color = new Color(0, 0, 0, .5f); }
public override void OnChange() { base.OnChange(); if (!_init) { return; } label.SetPosition(new Vector2(rad + 0.01f, rad + 0.01f)); if (!isProgress) { label.text = text; } else { label.text = progress.ToString("N" + Mathf.Clamp(progressDeci, 0, 4).ToString()) + "%"; } }
private void Player_MovementUpdate(On.Player.orig_MovementUpdate orig, Player self, bool eu) { #if DEBUG // intro if (introIndex < introText.Length) { introLabel.text += introText[introIndex].ToString(); introIndex++; } else if (introTimer++ == 120) { introLabel.isVisible = false; } #endif if (needToInitCat) { needToInitCat = false; #if DEBUG if (introLabel == null) { introLabel = new FLabel("font", ""); introLabel.SetPosition(120, 240); Futile.stage.AddChild(introLabel); } if (config.UnlimitedRedCycles && self.slugcatStats.name == SlugcatStats.Name.Red) { self.redsIllness.cycle = 9999; } #endif acc = self.slugcatStats.runspeedFac; minAcc = acc; maxAcc = acc * 1.75f; hookPos = new Vector2[self.bodyChunks.Length]; } BrokenTeleportation(self); BackFlipSlowmotion(self); AccMovement(self); AirInLungsX2(self); slugcatUnderWater = self.submerged; orig(self, eu); }
public ExposureController(Player player) { this.player = player; this.stats = this.player.slugcatStats; this.cam = this.player.room.game.cameras[0]; if (this.player.playerState.playerNumber == 0) { this.vignette = new Vignette(this); } this.dead = false; Debug.Log("EXPOSURE CONTROLLER - PLAYER " + this.player.playerState.playerNumber); if (Downpour.debug) { Vector2 sSize = this.player.abstractCreature.world.game.cameras[0].sSize; float offset = 80f * this.player.playerState.playerNumber; labelPlayer = new FLabel("font", "Player " + this.player.playerState.playerNumber); labelPlayer.SetPosition(30.01f, sSize.y - (25f + offset)); labelPlayer.color = new Color(0.4f, 0.3f, 0.8f); labelPlayer.alignment = FLabelAlignment.Left; labelPlayer.alpha = 0f; Futile.stage.AddChild(labelPlayer); labelExposure = new FLabel("font", ""); labelExposure.SetPosition(30.01f, sSize.y - (40f + offset)); labelExposure.color = new Color(0.3f, 1f, 1f); labelExposure.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelExposure); labelAmbient = new FLabel("font", ""); labelAmbient.SetPosition(30.01f, sSize.y - (55f + offset)); labelAmbient.color = new Color(0.3f, 1f, 1f); labelAmbient.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelAmbient); labelBlizzard = new FLabel("font", ""); labelBlizzard.SetPosition(30.01f, sSize.y - (70f + offset)); labelBlizzard.color = new Color(0.3f, 1f, 1f); labelBlizzard.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelBlizzard); labelCooldown = new FLabel("font", ""); labelCooldown.SetPosition(30.01f, sSize.y - (85f + offset)); labelCooldown.color = new Color(0.3f, 1f, 1f); labelCooldown.alignment = FLabelAlignment.Left; Futile.stage.AddChild(labelCooldown); } }
/// <summary> /// Circular Hold Button which can also be used as ProgressButton /// </summary> /// <param name="pos">BottomLeft <see cref="UIelement.pos"/>; <see cref="UIelement.fixedRad"/> is 55f (110f in diameter)</param> /// <param name="signal"><see cref="UItrigger.signal"/></param> /// <param name="fillTime">How long do you need to hold to call Signal (set to 0f for instant)</param> /// <param name="displayText">Text to be displayed (overriden when it's ProgressButton mode)</param> public OpHoldButton(Vector2 pos, string signal, string displayText, float fillTime = 80f) : base(pos, 55f, signal) { this.fillTime = Mathf.Max(0f, fillTime); fixedRad = 55f; _text = displayText; color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey); if (!_init) { return; } circles = new FSprite[5]; circles[0] = new FSprite("Futile_White") { shader = menu.manager.rainWorld.Shaders["VectorCircleFadable"] }; circles[1] = new FSprite("Futile_White") { shader = menu.manager.rainWorld.Shaders["VectorCircle"] }; circles[2] = new FSprite("Futile_White") { shader = menu.manager.rainWorld.Shaders["HoldButtonCircle"] }; circles[3] = new FSprite("Futile_White") { shader = menu.manager.rainWorld.Shaders["VectorCircle"] }; circles[4] = new FSprite("Futile_White") { shader = menu.manager.rainWorld.Shaders["VectorCircleFadable"] }; for (int i = 0; i < circles.Length; i++) { myContainer.AddChild(circles[i]); circles[i].SetPosition(55f, 55f); } label = new FLabel(LabelTest.GetFont(false), text) { alignment = FLabelAlignment.Center }; label.SetPosition(new Vector2(55.01f, 55.01f)); myContainer.AddChild(label); }
public MonklandUI(FStage stage) { worldStage = stage; uiContainer = new FContainer(); statusLabel = new FLabel("font", "STATUSLABEL"); statusLabel.alignment = FLabelAlignment.Left; statusLabel.SetPosition(50, Futile.screen.height - 50); uiContainer.AddChild(statusLabel); for (int i = 0; i < 200; i++) { FLabel displayLabel = new FLabel("font", string.Empty); uiContainer.AddChild(displayLabel); uiLabels.Add(displayLabel); } stage.AddChild(uiContainer); }
public void Update(ref Vector2 handlePos, ref Vector2?mousePos, bool dark) { if (hidden) { dragging = false; return; } handle.alpha = dark ? 0.4f : 1f; name.alpha = dark ? 0.2f : 1f; nameShadow.alpha = dark ? 0.1f : 0.75f; if (mousePos.HasValue && Input.GetMouseButton(0)) { if (dragging) { handlePos = mousePos.Value; mousePos = null; } else { if (PointOverHandle(mousePos.Value, handlePos) && Input.GetMouseButtonDown(0)) { dragging = true; mousePos = null; } } } else { dragging = false; } Vector2 drawPos = new Vector2(Mathf.Floor(handlePos.x) + 0.1f, Mathf.Floor(handlePos.y) + 0.1f); handle.SetPosition(drawPos); drawPos.x += 12f; name.SetPosition(drawPos); drawPos.x += 1f; drawPos.y -= 1f; nameShadow.SetPosition(drawPos); }
public InGamePage() { FSprite bg = new FSprite("Atlases/bg"); bg.width = Futile.screen.width; bg.height = Futile.screen.height; AddChild(bg); hudStuff = new FLabel("Minecraftia", "Energy:"); hudShadow = new FLabel("Minecraftia", "Energy:"); hudStuff.scale = 0.7f; hudShadow.scale = 0.7f; hudShadow.color = Color.black; hudStuff.SetPosition(new Vector2(0, (Futile.screen.height / 2) * 0.9f)); hudShadow.SetPosition(new Vector2(1f, ((Futile.screen.height / 2) * 0.9f - 1))); gameArea = new FContainer(); enemies = new List <Entity>(); projectiles = new List <Entity>(); Enemyprojectiles = new List <Entity>(); entityContainer = new FContainer(); projectileContainer = new FContainer(); particleContainer = new FContainer(); gameArea.AddChild(particleContainer); particleContainer.AddChild(projectilesParticles = new FParticleSystem(300)); gameArea.AddChild(entityContainer); gameArea.AddChild(projectileContainer); AddChild(gameArea); InGamePage.CurrentInGamePage = this; ListenForUpdate(Update); jugador = new Player(); GenerateFoe(); AddChild(hudShadow); AddChild(hudStuff); }
public SteamMultiplayerMenu(ProcessManager manager, bool shouldCreateLobby = false) : base(manager, ProcessManager.ProcessID.MainMenu) { if (shouldCreateLobby) { MonklandSteamManager.instance.CreateLobby(); } this.blackFade = 1f; this.lastBlackFade = 1f; this.pages.Add(new Page(this, null, "main", 0)); //this.scene = new InteractiveMenuScene( this, this.pages[0], MenuScene.SceneID.Landscape_SU ); //this.pages[0].subObjects.Add( this.scene ); this.darkSprite = new FSprite("pixel", true); this.darkSprite.color = new Color(0f, 0f, 0f); this.darkSprite.anchorX = 0f; this.darkSprite.anchorY = 0f; this.darkSprite.scaleX = 1368f; this.darkSprite.scaleY = 770f; this.darkSprite.x = -1f; this.darkSprite.y = -1f; this.darkSprite.alpha = 0.85f; this.pages[0].Container.AddChild(this.darkSprite); this.blackFadeSprite = new FSprite("Futile_White", true); this.blackFadeSprite.scaleX = 87.5f; this.gameStarting = false; this.blackFadeSprite.scaleY = 50f; this.blackFadeSprite.x = manager.rainWorld.screenSize.x / 2f; this.blackFadeSprite.y = manager.rainWorld.screenSize.y / 2f; this.blackFadeSprite.color = new Color(0f, 0f, 0f); Futile.stage.AddChild(this.blackFadeSprite); //Multiplayer Settings Box colorBox = new RoundedRect(this, this.pages[0], new Vector2(940, 125), new Vector2(400, 600), false); this.pages[0].subObjects.Add(colorBox); //Settings Label settingsLabel = new FLabel("font", "Multiplayer Settings"); settingsLabel.SetPosition(new Vector2(1140, manager.rainWorld.screenSize.y - 60)); Futile.stage.AddChild(this.settingsLabel); //Body Color Label bodyLabel = new FLabel("font", "Body Color"); bodyLabel.SetPosition(new Vector2(1140, manager.rainWorld.screenSize.y - 90)); Futile.stage.AddChild(this.bodyLabel); //Red Slider bodyRed = new HorizontalSlider(this, this.pages[0], "Red", new Vector2(960, manager.rainWorld.screenSize.y - 130), new Vector2(255, 30), (Slider.SliderID)patch_Slider.SliderID.BodyRed, false); bodyRed.floatValue = 1f; bodyRed.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyRed); //Green Slider bodyGreen = new HorizontalSlider(this, this.pages[0], "Green", new Vector2(960, manager.rainWorld.screenSize.y - 170), new Vector2(255, 30), (Slider.SliderID)patch_Slider.SliderID.BodyGreen, false); bodyGreen.floatValue = 1f; bodyGreen.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyGreen); //Blue Slider bodyBlue = new HorizontalSlider(this, this.pages[0], "Blue", new Vector2(960, manager.rainWorld.screenSize.y - 210), new Vector2(255, 30), (Slider.SliderID)patch_Slider.SliderID.BodyBlue, false); bodyBlue.floatValue = 1f; bodyBlue.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyBlue); //Eye Color Label eyesLabel = new FLabel("font", "Eye Color"); eyesLabel.SetPosition(new Vector2(1140, manager.rainWorld.screenSize.y - 235)); Futile.stage.AddChild(this.eyesLabel); //Red Slider eyesRed = new HorizontalSlider(this, this.pages[0], "Red ", new Vector2(960, manager.rainWorld.screenSize.y - 280), new Vector2(255, 30), (Slider.SliderID)patch_Slider.SliderID.EyesRed, false); eyesRed.floatValue = 0f; this.pages[0].subObjects.Add(this.eyesRed); //Green Slider eyesGreen = new HorizontalSlider(this, this.pages[0], "Green ", new Vector2(960, manager.rainWorld.screenSize.y - 320), new Vector2(255, 30), (Slider.SliderID)patch_Slider.SliderID.EyesGreen, false); eyesGreen.floatValue = 0f; this.pages[0].subObjects.Add(this.eyesGreen); //Blue Slider eyesBlue = new HorizontalSlider(this, this.pages[0], "Blue ", new Vector2(960, manager.rainWorld.screenSize.y - 360), new Vector2(255, 30), (Slider.SliderID)patch_Slider.SliderID.EyesBlue, false); eyesBlue.floatValue = 0f; this.pages[0].subObjects.Add(this.eyesBlue); //Slugcat Eyes Sprite eyes = new FSprite("FoodCircleB", true); eyes.scaleX = 1f; eyes.scaleY = 1f; eyes.color = new Color(0, 0, 0); eyes.x = 964; eyes.y = manager.rainWorld.screenSize.y - 236; eyes.isVisible = true; this.pages[0].Container.AddChild(this.eyes); //Slugcat Sprite slugcat = new FSprite("slugcatSleeping", true); slugcat.scaleX = 1f; slugcat.scaleY = 1f; slugcat.color = new Color(1f, 1f, 1f); slugcat.x = 970; slugcat.y = manager.rainWorld.screenSize.y - 235; slugcat.isVisible = true; this.pages[0].Container.AddChild(this.slugcat); //Back button this.backButton = new SimpleButton(this, this.pages[0], base.Translate("BACK"), "EXIT", new Vector2(100f, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.backButton); //Back button this.backButton = new SimpleButton(this, this.pages[0], base.Translate("BACK"), "EXIT", new Vector2(100f, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.backButton); //Start Game button this.startGameButton = new SimpleButton(this, this.pages[0], "Start Game", "STARTGAME", new Vector2(1060, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.startGameButton); //Ready Up button this.readyUpButton = new SimpleButton(this, this.pages[0], "Ready UP", "READYUP", new Vector2(940, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.readyUpButton); //Multiplayer Chat this.gameChat = new MultiplayerChat(this, this.pages[0], new Vector2(320, 125), new Vector2(600, 600)); this.pages[0].subObjects.Add(this.gameChat); //Invite menu playerList = new MultiplayerPlayerList(this, this.pages[0], new Vector2(100, 125), new Vector2(200, 600), new Vector2(180, 180)); this.pages[0].subObjects.Add(this.playerList); //Controller Combatability this.bodyRed.nextSelectable[1] = this.readyUpButton; this.bodyRed.nextSelectable[3] = this.bodyGreen; this.bodyGreen.nextSelectable[1] = this.bodyRed; this.bodyGreen.nextSelectable[3] = this.bodyBlue; this.bodyBlue.nextSelectable[1] = this.bodyGreen; this.bodyBlue.nextSelectable[3] = this.eyesRed; this.eyesRed.nextSelectable[1] = this.bodyBlue; this.eyesRed.nextSelectable[3] = this.eyesGreen; this.eyesGreen.nextSelectable[1] = this.eyesRed; this.eyesGreen.nextSelectable[3] = this.eyesBlue; this.eyesBlue.nextSelectable[1] = this.eyesGreen; this.eyesBlue.nextSelectable[3] = this.readyUpButton; this.readyUpButton.nextSelectable[0] = this.backButton; this.readyUpButton.nextSelectable[1] = this.eyesBlue; this.readyUpButton.nextSelectable[2] = this.startGameButton; this.readyUpButton.nextSelectable[3] = this.bodyRed; this.startGameButton.nextSelectable[0] = this.readyUpButton; this.startGameButton.nextSelectable[1] = this.eyesBlue; this.startGameButton.nextSelectable[2] = this.backButton; this.startGameButton.nextSelectable[3] = this.bodyRed; this.backButton.nextSelectable[0] = this.startGameButton; this.backButton.nextSelectable[2] = this.readyUpButton; this.backButton.nextSelectable[1] = this.bodyRed; this.backButton.nextSelectable[3] = this.eyesBlue; //Some Nice Music :) if (manager.musicPlayer != null) { manager.musicPlayer.MenuRequestsSong("NA_05 - Sparkles", 1.2f, 10f); } }
void loadTiles() { foreach (PlatformData platform in levelData.getPlatformData()) { FSprite plat = new FSprite(platform.image); plat.height = 16; plat.width = 16; tileSize = plat.width; Tiles[(int)platform.x, (int)platform.y] = 1; // make them overlap a little to avoid those ungly lines in the rendering. plat.SetPosition(new Vector2((platform.x * plat.width), (-platform.y * plat.height))); AddChild(plat); } playerBullets = new List<Bullet>(); hazards = new List<Hazard>(); particleContainer = new FContainer(); AddChild(particleContainer); enemyContainer = new FContainer(); AddChild(enemyContainer); particles = new FParticleSystem(50); particleContainer.AddChild(particles); projectileContainer = new FContainer(); AddChild(projectileContainer); entityContainer = new FContainer(); AddChild(entityContainer); frontContainer = new FContainer(); AddChild(frontContainer); this.alpha = 0; TweenConfig tw = new TweenConfig(); tw.floatProp("alpha", 1); Go.to(this, 10f, tw); stats = new FLabel("font", "Jump Packs: 0; reload times: 0"); CurrentPage.GetHUD().AddChild(stats); stats.scale = 0.9f; stats.SetPosition(new Vector2(Futile.screen.halfWidth, Futile.screen.height * 0.9f)); }
public override void Start() { Main.instance.crewSaved = 0; Main.instance.gameFinished = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _introLabel = new FLabel("Emulogic", ""); _introLabel.color = Color.black; //Color.green; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _introLabel.scale = 0.2f; _introLabel.SetAnchor(0.0f, 1.0f); _introLabel.SetPosition(60, Futile.screen.height - 14); AddChild(_introLabel); _titleLabel = new FLabel("Emulogic", ""); _titleLabel.color = Color.black; _titleLabel.scale = 1.0f; _titleLabel.SetAnchor(0.0f, 1.0f); _titleLabel.SetPosition(200, 550); AddChild(_titleLabel); _finalLabel = new FLabel("Emulogic", ""); _finalLabel.color = Color.black; //Color.green; _finalLabel.scale = 0.2f; _finalLabel.SetAnchor(0.0f, 1.0f); _finalLabel.SetPosition(575, 400); AddChild(_finalLabel); if (!Main.instance.playIntro){ _introLabel.text = _introText; _titleLabel.text = _titleText; _finalLabel.text = _finalText; } _startButton = new FButton("buttonWide"); _startButton.AddLabel("Emulogic","Play!",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _startButton.label.scale = 0.25f; _startButton.SetPosition(Futile.screen.width - 225, 155); AddChild(_startButton); _startButton.SignalRelease += HandleStartButtonRelease; _creditsButton = new FButton("buttonWide"); _creditsButton.AddLabel("Emulogic","About",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _creditsButton.label.scale = 0.25f; _creditsButton.SetPosition(Futile.screen.width - 225, 75); AddChild(_creditsButton); _creditsButton.SignalRelease += HandleCreditsButtonRelease; _lastTextUpdate = Main.GameTime; FSprite escapePod = new FSprite("escapePod"); FSprite doors = new FSprite("doorsIcon"); FSprite crew = new FSprite("floatingCharacter"); FSprite clock = new FSprite("moveTileIcon"); //FSprite clock = new FSprite("clock4"); escapePod.scale = 0.5f; doors.scale = 0.5f; escapePod.SetPosition(140, 305); doors.SetPosition(140, 230); crew.SetPosition(140, 155); clock.SetPosition(140, 80); AddChild(escapePod); AddChild(doors); AddChild(crew); AddChild(clock); FLabel escapePodLabel = new FLabel("Emulogic", "Get the crew to \nthe escape pods!"); escapePodLabel.color = Color.black; //Color.green; escapePodLabel.scale = 0.15f; escapePodLabel.SetAnchor(0.0f, 0.5f); escapePodLabel.SetPosition(200, 305); AddChild(escapePodLabel); FLabel doorsLabel = new FLabel("Emulogic", "Touch doors to \nopen and close them."); doorsLabel.color = Color.black; //Color.green; doorsLabel.scale = 0.15f; doorsLabel.SetAnchor(0.0f, 0.5f); doorsLabel.SetPosition(200, 230); AddChild(doorsLabel); FLabel crewLabel = new FLabel("Emulogic", "The Crew. They will walk \nthrough open doors, \nbut don't expect much else."); crewLabel.color = Color.black; //Color.green; crewLabel.scale = 0.15f; crewLabel.SetAnchor(0.0f, 0.5f); crewLabel.SetPosition(200, 155); AddChild(crewLabel); FLabel clockLabel = new FLabel("Emulogic", "Place movement tiles \nto redirect the crew."); //FLabel clockLabel = new FLabel("Emulogic", "10 Seconds."); clockLabel.color = Color.black; //Color.green; clockLabel.scale = 0.15f; clockLabel.SetAnchor(0.0f, 0.5f); clockLabel.SetPosition(200, 80); AddChild(clockLabel); }
public World(int level) { string beginningMessage = ""; if (beginningMessages.Length > level) { beginningMessage = beginningMessages[level]; } beginningLabel = new FLabel("Large", beginningMessage); beginningLabel.alpha = 1.0f; beginningLabel.y = -70; beginningLabelShadow = new FLabel("Large", beginningMessage); beginningLabelShadow.color = Color.black; beginningLabelShadow.SetPosition(beginningLabel.GetPosition()); beginningLabelShadow.x += 1; beginningLabelShadow.y += -1; this.currentLevelNum = level; string levelName = "Maps/map" + level; this.startNumPlayers = enemiesOnLevel[level]; clock = new Clock(); clock.enableSound(); enemyClock = new EnemyClock(); gui = new FCamObject(); gui.AddChild(clock); gui.AddChild(enemyClock); setClock(clock); Futile.stage.AddChild(playerLayer); tmxMap.LoadTMX(levelName); tilemap = (FTilemap)(tmxMap.getLayerNamed("Tilemap")); FTilemap objectLayer = (FTilemap)(tmxMap.getLayerNamed("Objects")); for (int xInd = 0; xInd < objectLayer.widthInTiles; xInd++) { for (int yInd = 0; yInd < objectLayer.heightInTiles; yInd++) { switch (objectLayer.getFrameNum(xInd, yInd)) { case 0: break; case 10: FNode newSpawn = new FNode(); newSpawn.x = xInd * tilemap._tileWidth + tilemap._tileWidth / 2; newSpawn.y = -yInd * tilemap._tileHeight - tilemap._tileHeight / 2; spawnPoints.Add(newSpawn); break; case 11: playerSpawn = new FNode(); playerSpawn.x = xInd * tilemap._tileWidth + tilemap._tileWidth / 2; playerSpawn.y = -yInd * tilemap._tileHeight - tilemap._tileHeight / 2; break; } } } this.miniMap = new Minimap(this); playerLayer.AddChild(tmxMap); tilemap.clipNode = gui; Player player = new Player(true); gui.follow(player); addPlayer(player); player.setScale(2.0f, true); miniMap.setFollow(player); for (int ind = 0; ind < startNumPlayers; ind++) { Player p = new Player(); addPlayer(p); } Futile.stage.AddChild(gui); gui.AddChild(new MuteMusicButton()); gui.AddChild(miniMap); gui.AddChild(beginningLabelShadow); gui.AddChild(beginningLabel); }
override public void Start() { Main.instance.crewSaved = 0; Main.instance.gameFinished = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _introLabel = new FLabel("Emulogic", ""); _introLabel.color = Color.black; //Color.green; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _introLabel.scale = 0.2f; _introLabel.SetAnchor(0.0f, 1.0f); _introLabel.SetPosition(60, Futile.screen.height - 14); AddChild(_introLabel); _titleLabel = new FLabel("Emulogic", ""); _titleLabel.color = Color.black; _titleLabel.scale = 1.0f; _titleLabel.SetAnchor(0.0f, 1.0f); _titleLabel.SetPosition(200, 550); AddChild(_titleLabel); _finalLabel = new FLabel("Emulogic", ""); _finalLabel.color = Color.black; //Color.green; _finalLabel.scale = 0.2f; _finalLabel.SetAnchor(0.0f, 1.0f); _finalLabel.SetPosition(575, 400); AddChild(_finalLabel); if (!Main.instance.playIntro) { _introLabel.text = _introText; _titleLabel.text = _titleText; _finalLabel.text = _finalText; } _startButton = new FButton("buttonWide"); _startButton.AddLabel("Emulogic", "Play!", Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _startButton.label.scale = 0.25f; _startButton.SetPosition(Futile.screen.width - 225, 155); AddChild(_startButton); _startButton.SignalRelease += HandleStartButtonRelease; _creditsButton = new FButton("buttonWide"); _creditsButton.AddLabel("Emulogic", "About", Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _creditsButton.label.scale = 0.25f; _creditsButton.SetPosition(Futile.screen.width - 225, 75); AddChild(_creditsButton); _creditsButton.SignalRelease += HandleCreditsButtonRelease; _lastTextUpdate = Main.GameTime; FSprite escapePod = new FSprite("escapePod"); FSprite doors = new FSprite("doorsIcon"); FSprite crew = new FSprite("floatingCharacter"); FSprite clock = new FSprite("moveTileIcon"); //FSprite clock = new FSprite("clock4"); escapePod.scale = 0.5f; doors.scale = 0.5f; escapePod.SetPosition(140, 305); doors.SetPosition(140, 230); crew.SetPosition(140, 155); clock.SetPosition(140, 80); AddChild(escapePod); AddChild(doors); AddChild(crew); AddChild(clock); FLabel escapePodLabel = new FLabel("Emulogic", "Get the crew to \nthe escape pods!"); escapePodLabel.color = Color.black; //Color.green; escapePodLabel.scale = 0.15f; escapePodLabel.SetAnchor(0.0f, 0.5f); escapePodLabel.SetPosition(200, 305); AddChild(escapePodLabel); FLabel doorsLabel = new FLabel("Emulogic", "Touch doors to \nopen and close them."); doorsLabel.color = Color.black; //Color.green; doorsLabel.scale = 0.15f; doorsLabel.SetAnchor(0.0f, 0.5f); doorsLabel.SetPosition(200, 230); AddChild(doorsLabel); FLabel crewLabel = new FLabel("Emulogic", "The Crew. They will walk \nthrough open doors, \nbut don't expect much else."); crewLabel.color = Color.black; //Color.green; crewLabel.scale = 0.15f; crewLabel.SetAnchor(0.0f, 0.5f); crewLabel.SetPosition(200, 155); AddChild(crewLabel); FLabel clockLabel = new FLabel("Emulogic", "Place movement tiles \nto redirect the crew."); //FLabel clockLabel = new FLabel("Emulogic", "10 Seconds."); clockLabel.color = Color.black; //Color.green; clockLabel.scale = 0.15f; clockLabel.SetAnchor(0.0f, 0.5f); clockLabel.SetPosition(200, 80); AddChild(clockLabel); }
public LobbyFinderMenu(ProcessManager manager) : base(manager, ProcessManager.ProcessID.MainMenu) { #region UI ELEMENTS SIZE DEFINITION float resOffset = (1366 - manager.rainWorld.screenSize.x) / 2; // shift everything to the right depending on the resolution. 1/2 of the diff with the max resolution. float screenWidth = manager.rainWorld.screenSize.x; float screenHeight = manager.rainWorld.screenSize.y; // initialize some dynamic sizes and positions for UI elements. // player list and multiplayer settings have the same size no matter what the resolution. // the room chat adjusts to fill all the middle space float panelGutter = 15; // gap width between the panels float multiplayerSettingsWidth = 300; // constant float multiplayerSettingsSliderWidth = multiplayerSettingsWidth - 115; // constant float multiplayerSettingsPositionX = screenWidth - (multiplayerSettingsWidth + panelGutter); // position depending on screen width float multiplayerSettingsSliderPositionX = multiplayerSettingsPositionX + 10; // constant float controlButtonSpaceHeight = 100; // constant float panelHeight = screenHeight - (controlButtonSpaceHeight + panelGutter * 2); // leaving a space for bottom control buttons float panelPositionY = controlButtonSpaceHeight; // constant float lobbyFinderHeight = screenHeight - (controlButtonSpaceHeight + (panelGutter) + 50); // leaving a space for top and bottom control buttons float lobbyFinderWidth = (screenWidth - (multiplayerSettingsWidth + panelGutter * 3)) / 1.5f; // depends on resolution float lobbyFinderPositionX = resOffset + panelGutter; float lobbyFinderPositionY = panelPositionY; float lobbyCreatorHeight = screenHeight - (controlButtonSpaceHeight + panelGutter * 2); float lobbyCreatorWidth = screenWidth - (multiplayerSettingsWidth + lobbyFinderWidth + panelGutter * 4); float privacyButtonWidth = (lobbyCreatorWidth - 20 - (panelGutter * 2)) / 3f; float lobbyCreatorSliderWidth = lobbyCreatorWidth - 115; float lobbyCreatorPositionX = resOffset + panelGutter * 2 + lobbyFinderWidth; float lobbyCreatorPositionY = panelPositionY; float lobbyCreatorSliderPositionX = lobbyCreatorPositionX + 10; #endregion UI ELEMENTS SIZE DEFINITION this.lobbynum = 0; hosting = true; this.blackFade = 1f; this.lastBlackFade = 1f; this.pages.Add(new Page(this, null, "main", 0)); //this.scene = new InteractiveMenuScene( this, this.pages[0], MenuScene.SceneID.Landscape_SU ); //this.pages[0].subObjects.Add( this.scene ); this.darkSprite = new FSprite("pixel", true); this.darkSprite.color = new Color(0f, 0f, 0f); this.darkSprite.anchorX = 0f; this.darkSprite.anchorY = 0f; this.darkSprite.scaleX = screenWidth; this.darkSprite.scaleY = screenHeight; this.darkSprite.x = screenWidth / 2f; this.darkSprite.y = screenHeight / 2f; this.darkSprite.alpha = 0.85f; this.pages[0].Container.AddChild(this.darkSprite); this.blackFadeSprite = new FSprite("Futile_White", true); this.blackFadeSprite.scaleX = 87.5f; this.blackFadeSprite.scaleY = 50f; this.blackFadeSprite.x = screenWidth / 2f; this.blackFadeSprite.y = screenHeight / 2f; this.blackFadeSprite.color = new Color(0f, 0f, 0f); Futile.stage.AddChild(this.blackFadeSprite); //Multiplayer Settings Box colorBox = new RoundedRect(this, this.pages[0], new Vector2(resOffset + multiplayerSettingsPositionX, panelPositionY), new Vector2(multiplayerSettingsWidth, panelHeight), false); this.pages[0].subObjects.Add(colorBox); //Settings Label settingsLabel = new FLabel("font", "Multiplayer Settings"); settingsLabel.SetPosition(new Vector2(multiplayerSettingsPositionX + 70.01f, screenHeight - 60.01f)); Futile.stage.AddChild(this.settingsLabel); //Body Color Label bodyLabel = new FLabel("font", "Body Color"); bodyLabel.SetPosition(new Vector2(multiplayerSettingsPositionX + 70.01f, screenHeight - 90.01f)); Futile.stage.AddChild(this.bodyLabel); //Red Slider bodyRed = new HorizontalSlider(this, this.pages[0], "Red", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 130), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)(-1), false); bodyRed.floatValue = MonklandSteamManager.bodyColor.r; bodyRed.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyRed); //Green Slider bodyGreen = new HorizontalSlider(this, this.pages[0], "Green", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 170), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)(-1), false); bodyGreen.floatValue = MonklandSteamManager.bodyColor.g; bodyGreen.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyGreen); //Blue Slider bodyBlue = new HorizontalSlider(this, this.pages[0], "Blue", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 210), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)(-1), false); bodyBlue.floatValue = MonklandSteamManager.bodyColor.b; bodyBlue.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyBlue); //Eye Color Label eyesLabel = new FLabel("font", "Eye Color"); eyesLabel.SetPosition(new Vector2(multiplayerSettingsPositionX + 70.01f, screenHeight - 240.01f)); Futile.stage.AddChild(this.eyesLabel); //Red Slider eyesRed = new HorizontalSlider(this, this.pages[0], "Red ", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 280), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)(-1), false); eyesRed.floatValue = MonklandSteamManager.eyeColor.r; this.pages[0].subObjects.Add(this.eyesRed); //Green Slider eyesGreen = new HorizontalSlider(this, this.pages[0], "Green ", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 320), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)(-1), false); eyesGreen.floatValue = MonklandSteamManager.eyeColor.g; this.pages[0].subObjects.Add(this.eyesGreen); //Blue Slider eyesBlue = new HorizontalSlider(this, this.pages[0], "Blue ", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 360), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)(-1), false); eyesBlue.floatValue = MonklandSteamManager.eyeColor.b; this.pages[0].subObjects.Add(this.eyesBlue); //Slugcat Eyes Sprite eyes = new FSprite("FoodCircleB", true); eyes.scaleX = 1f; eyes.scaleY = 1.1f; eyes.color = new Color(0, 0, 0); eyes.x = multiplayerSettingsPositionX + 130; eyes.y = manager.rainWorld.screenSize.y - 236; eyes.isVisible = true; this.pages[0].Container.AddChild(this.eyes); //Slugcat Sprite slugcat = new FSprite("slugcatSleeping", true); slugcat.scaleX = 1f; slugcat.scaleY = 1f; slugcat.color = new Color(1f, 1f, 1f); slugcat.x = multiplayerSettingsPositionX + 136; slugcat.y = manager.rainWorld.screenSize.y - 235; slugcat.isVisible = true; this.pages[0].Container.AddChild(this.slugcat); //Slugcat Buttons this.slugcatButtons = new SelectOneButton[3]; this.slugcatButtons[0] = new SelectOneButton(this, this.pages[0], base.Translate("SURVIOR"), "Slugcat", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 445f), new Vector2(110f, 30f), this.slugcatButtons, 0); this.pages[0].subObjects.Add(this.slugcatButtons[0]); this.slugcatButtons[1] = new SelectOneButton(this, this.pages[0], base.Translate("MONK"), "Slugcat", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 490f), new Vector2(110f, 30f), this.slugcatButtons, 1); this.pages[0].subObjects.Add(this.slugcatButtons[1]); this.slugcatButtons[2] = new SelectOneButton(this, this.pages[0], base.Translate("HUNTER"), "Slugcat", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 535f), new Vector2(110f, 30f), this.slugcatButtons, 2); this.pages[0].subObjects.Add(this.slugcatButtons[2]); //Debug Mode checkbox this.debugCheckBox = new CheckBox(this, this.pages[0], this, new Vector2(resOffset + multiplayerSettingsSliderPositionX + 120, screenHeight - 400), 120f, "Debug Mode", "DEBUG"); this.pages[0].subObjects.Add(this.debugCheckBox); //Back button this.backButton = new SimpleButton(this, this.pages[0], base.Translate("BACK"), "EXIT", new Vector2(resOffset + 15f, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.backButton); //Lobby Finder Box lobbyFinderBox = new RoundedRect(this, this.pages[0], new Vector2(lobbyFinderPositionX, lobbyFinderPositionY), new Vector2(lobbyFinderWidth, lobbyFinderHeight), false); this.pages[0].subObjects.Add(lobbyFinderBox); //Refresh button this.refreshButton = new SimpleButton(this, this.pages[0], "Refresh", "REFRESH", new Vector2(lobbyFinderPositionX + lobbyFinderWidth - 110, screenHeight - 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.refreshButton); //Lobby browser Labels: this.namesLabel = new FLabel("font", "CREATED BY"); this.namesLabel.SetPosition(new Vector2(lobbyFinderPositionX + 60.01f - resOffset + (lobbyFinderWidth / 10), screenHeight - 75.01f)); Futile.stage.AddChild(this.namesLabel); this.versionsLabel = new FLabel("font", "VERSION"); this.versionsLabel.SetPosition(new Vector2(lobbyFinderPositionX + 60.01f - resOffset + 1.8f * (lobbyFinderWidth / 5), screenHeight - 75.01f)); Futile.stage.AddChild(this.versionsLabel); this.playersLabel = new FLabel("font", "PLAYERS"); this.playersLabel.SetPosition(new Vector2(lobbyFinderPositionX + 60.01f - resOffset + 2.9f * (lobbyFinderWidth / 5), screenHeight - 75.01f)); Futile.stage.AddChild(this.playersLabel); this.maxLabel = new FLabel("font", "MAX"); this.maxLabel.SetPosition(new Vector2(lobbyFinderPositionX + 60.01f - resOffset + 4 * (lobbyFinderWidth / 6), screenHeight - 75.01f)); Futile.stage.AddChild(this.maxLabel); //Join buttons this.joinButtons = new SimpleButton[15]; this.lobbynames = new FLabel[this.joinButtons.Length]; this.lobbyVersions = new FLabel[this.joinButtons.Length]; this.lobbyPlayerCounts = new FLabel[this.joinButtons.Length]; this.lobbyPlayerMaxs = new FLabel[this.joinButtons.Length]; float buttonheight = (lobbyFinderHeight - 30) / this.joinButtons.Length; for (int i = 0; i < this.joinButtons.Length; i++) { this.lobbynames[i] = new FLabel("font", "-"); this.lobbynames[i].SetPosition(new Vector2(lobbyFinderPositionX + 60 - resOffset + (lobbyFinderWidth / 10), screenHeight - 100f - (buttonheight * i))); Futile.stage.AddChild(this.lobbynames[i]); this.lobbyVersions[i] = new FLabel("font", "-"); this.lobbyVersions[i].SetPosition(new Vector2(lobbyFinderPositionX + 60 - resOffset + 1.8f * (lobbyFinderWidth / 5), screenHeight - 100f - (buttonheight * i))); Futile.stage.AddChild(this.lobbyVersions[i]); this.lobbyPlayerCounts[i] = new FLabel("font", "-"); this.lobbyPlayerCounts[i].SetPosition(new Vector2(lobbyFinderPositionX + 60 - resOffset + 2.9f * (lobbyFinderWidth / 5), screenHeight - 100f - (buttonheight * i))); Futile.stage.AddChild(this.lobbyPlayerCounts[i]); this.lobbyPlayerMaxs[i] = new FLabel("font", "-"); this.lobbyPlayerMaxs[i].SetPosition(new Vector2(lobbyFinderPositionX + 60 - resOffset + 4 * (lobbyFinderWidth / 6), screenHeight - 100f - (buttonheight * i))); Futile.stage.AddChild(this.lobbyPlayerMaxs[i]); this.joinButtons[i] = new SimpleButton(this, this.pages[0], "Join", "JOIN" + i, new Vector2(lobbyFinderPositionX + lobbyFinderWidth - 75f, screenHeight - 110f - (buttonheight * i)), new Vector2(60f, buttonheight - 10)); this.pages[0].subObjects.Add(this.joinButtons[i]); } //Host or Join Buttons this.modeButtons = new SelectOneButton[2]; this.modeButtons[1] = new SelectOneButton(this, this.pages[0], base.Translate("JOIN"), "Mode", new Vector2(resOffset + 15, screenHeight - 50f), new Vector2(110f, 30f), this.modeButtons, 1); this.pages[0].subObjects.Add(this.modeButtons[1]); this.modeButtons[0] = new SelectOneButton(this, this.pages[0], base.Translate("HOST"), "Mode", new Vector2(resOffset + 140, screenHeight - 50f), new Vector2(110f, 30f), this.modeButtons, 0); this.pages[0].subObjects.Add(this.modeButtons[0]); //Lobby Creator Box lobbyFinderBox = new RoundedRect(this, this.pages[0], new Vector2(lobbyCreatorPositionX, lobbyCreatorPositionY), new Vector2(lobbyCreatorWidth, lobbyCreatorHeight), false); this.pages[0].subObjects.Add(lobbyFinderBox); //Lobby Creator Label creatorLabel = new FLabel("font", "Lobby Settings"); creatorLabel.SetPosition(new Vector2(lobbyCreatorPositionX + 60.01f - resOffset, screenHeight - 60.01f)); Futile.stage.AddChild(this.creatorLabel); //Lobby Type Buttons this.privacyButtons = new SelectOneButton[3]; this.privacyButtons[0] = new SelectOneButton(this, this.pages[0], base.Translate("PUBLIC"), "LobbyType", new Vector2(lobbyCreatorSliderPositionX, screenHeight - 130f), new Vector2(privacyButtonWidth, 30f), this.slugcatButtons, 0); this.pages[0].subObjects.Add(this.privacyButtons[0]); this.privacyButtons[1] = new SelectOneButton(this, this.pages[0], base.Translate("FRIENDS"), "LobbyType", new Vector2(lobbyCreatorSliderPositionX + privacyButtonWidth + 15, screenHeight - 130f), new Vector2(privacyButtonWidth, 30f), this.slugcatButtons, 1); this.pages[0].subObjects.Add(this.privacyButtons[1]); this.privacyButtons[2] = new SelectOneButton(this, this.pages[0], base.Translate("PRIVATE"), "LobbyType", new Vector2(lobbyCreatorSliderPositionX + 2 * privacyButtonWidth + 30, screenHeight - 130f), new Vector2(privacyButtonWidth, 30f), this.slugcatButtons, 2); this.pages[0].subObjects.Add(this.privacyButtons[2]); //Players Slider maxPlayersSlider = new HorizontalSlider(this, this.pages[0], "", new Vector2(lobbyCreatorSliderPositionX, screenHeight - 170), new Vector2(lobbyCreatorSliderWidth + 70, 30), (Slider.SliderID)(-1), false); maxPlayersSlider.floatValue = 10f / 100f; maxPlayersSlider.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.maxPlayersSlider); //Max Players Label maxPlayersLabel = new FLabel("font", "Max Players: 10"); maxPlayersLabel.SetPosition(new Vector2(lobbyCreatorSliderPositionX + (lobbyCreatorWidth / 2) - 20.01f - resOffset, screenHeight - 200.01f)); Futile.stage.AddChild(this.maxPlayersLabel); //Spears checkbox this.spearsHitBox = new CheckBox(this, this.pages[0], this, new Vector2(lobbyCreatorSliderPositionX + 120, screenHeight - 250), 120f, "Spears Hit", "SPEARSHIT"); this.pages[0].subObjects.Add(this.spearsHitBox); //Allow Debug checkbox this.debugAllowBox = new CheckBox(this, this.pages[0], this, new Vector2(lobbyCreatorSliderPositionX + 120, screenHeight - 280), 120f, "Allow Debug Mode", "ALLOWDEBUG"); this.pages[0].subObjects.Add(this.debugAllowBox); //Start Game button this.startLobbyButton = new SimpleButton(this, this.pages[0], "Start Lobby", "STARTLOBBY", new Vector2(lobbyCreatorPositionX + lobbyCreatorWidth - 110, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.startLobbyButton); //Controller Combatability this.bodyRed.nextSelectable[0] = this.privacyButtons[2]; this.bodyRed.nextSelectable[1] = this.startLobbyButton; this.bodyRed.nextSelectable[3] = this.bodyGreen; this.bodyRed.nextSelectable[2] = this.modeButtons[1]; this.bodyGreen.nextSelectable[0] = this.maxPlayersSlider; this.bodyGreen.nextSelectable[1] = this.bodyRed; this.bodyGreen.nextSelectable[3] = this.bodyBlue; this.bodyGreen.nextSelectable[2] = this.modeButtons[1]; this.bodyBlue.nextSelectable[0] = this.maxPlayersSlider; this.bodyBlue.nextSelectable[1] = this.bodyGreen; this.bodyBlue.nextSelectable[3] = this.eyesRed; this.bodyBlue.nextSelectable[2] = this.modeButtons[1]; this.eyesRed.nextSelectable[0] = this.spearsHitBox; this.eyesRed.nextSelectable[1] = this.bodyBlue; this.eyesRed.nextSelectable[3] = this.eyesGreen; this.eyesRed.nextSelectable[2] = this.modeButtons[1]; this.eyesGreen.nextSelectable[0] = this.debugAllowBox; this.eyesGreen.nextSelectable[1] = this.eyesRed; this.eyesGreen.nextSelectable[3] = this.eyesBlue; this.eyesGreen.nextSelectable[2] = this.modeButtons[1]; this.eyesBlue.nextSelectable[0] = this.debugAllowBox; this.eyesBlue.nextSelectable[1] = this.eyesGreen; this.eyesBlue.nextSelectable[3] = this.debugCheckBox; this.eyesBlue.nextSelectable[2] = this.modeButtons[1]; this.debugCheckBox.nextSelectable[0] = this.debugAllowBox; this.debugCheckBox.nextSelectable[1] = this.eyesBlue; this.debugCheckBox.nextSelectable[3] = this.slugcatButtons[0]; this.debugCheckBox.nextSelectable[2] = this.backButton; this.slugcatButtons[0].nextSelectable[0] = this.debugAllowBox; this.slugcatButtons[0].nextSelectable[1] = this.debugCheckBox; this.slugcatButtons[0].nextSelectable[3] = this.slugcatButtons[1]; this.slugcatButtons[0].nextSelectable[2] = this.backButton; this.slugcatButtons[1].nextSelectable[0] = this.debugAllowBox; this.slugcatButtons[1].nextSelectable[1] = this.slugcatButtons[0]; this.slugcatButtons[1].nextSelectable[3] = this.slugcatButtons[2]; this.slugcatButtons[1].nextSelectable[2] = this.backButton; this.slugcatButtons[2].nextSelectable[0] = this.debugAllowBox; this.slugcatButtons[2].nextSelectable[1] = this.slugcatButtons[1]; this.slugcatButtons[2].nextSelectable[3] = this.startLobbyButton; this.slugcatButtons[2].nextSelectable[2] = this.backButton; this.backButton.nextSelectable[0] = this.startLobbyButton; this.backButton.nextSelectable[1] = this.modeButtons[1]; this.backButton.nextSelectable[3] = this.modeButtons[1]; this.backButton.nextSelectable[2] = this.startLobbyButton; this.startLobbyButton.nextSelectable[0] = this.backButton; this.startLobbyButton.nextSelectable[1] = this.debugAllowBox; this.startLobbyButton.nextSelectable[3] = this.privacyButtons[2]; this.startLobbyButton.nextSelectable[2] = this.backButton; this.modeButtons[1].nextSelectable[0] = this.bodyRed; this.modeButtons[1].nextSelectable[1] = this.backButton; this.modeButtons[1].nextSelectable[3] = this.backButton; this.modeButtons[1].nextSelectable[2] = this.modeButtons[0]; this.modeButtons[0].nextSelectable[0] = this.modeButtons[1]; this.modeButtons[0].nextSelectable[1] = this.backButton; this.modeButtons[0].nextSelectable[3] = this.backButton; this.modeButtons[0].nextSelectable[2] = this.refreshButton; this.refreshButton.nextSelectable[0] = this.modeButtons[0]; this.refreshButton.nextSelectable[1] = this.joinButtons[this.joinButtons.Length - 1]; this.refreshButton.nextSelectable[3] = this.joinButtons[0]; this.refreshButton.nextSelectable[2] = this.refreshButton; this.privacyButtons[0].nextSelectable[0] = this.joinButtons[0]; this.privacyButtons[0].nextSelectable[1] = this.startLobbyButton; this.privacyButtons[0].nextSelectable[3] = this.maxPlayersSlider; this.privacyButtons[0].nextSelectable[2] = this.privacyButtons[1]; this.privacyButtons[1].nextSelectable[0] = this.privacyButtons[0]; this.privacyButtons[1].nextSelectable[1] = this.startLobbyButton; this.privacyButtons[1].nextSelectable[3] = this.maxPlayersSlider; this.privacyButtons[1].nextSelectable[2] = this.privacyButtons[2]; this.privacyButtons[2].nextSelectable[0] = this.privacyButtons[1]; this.privacyButtons[2].nextSelectable[1] = this.startLobbyButton; this.privacyButtons[2].nextSelectable[3] = this.maxPlayersSlider; this.privacyButtons[2].nextSelectable[2] = this.bodyRed; this.maxPlayersSlider.nextSelectable[1] = this.privacyButtons[1]; this.maxPlayersSlider.nextSelectable[3] = this.spearsHitBox; this.spearsHitBox.nextSelectable[0] = this.joinButtons[4]; this.spearsHitBox.nextSelectable[1] = this.maxPlayersSlider; this.spearsHitBox.nextSelectable[3] = this.spearsHitBox; this.spearsHitBox.nextSelectable[2] = this.bodyGreen; this.debugAllowBox.nextSelectable[0] = this.joinButtons[5]; this.debugAllowBox.nextSelectable[1] = this.spearsHitBox; this.debugAllowBox.nextSelectable[3] = this.startLobbyButton; this.debugAllowBox.nextSelectable[2] = this.eyesRed; //Some Nice Music :) if (manager.musicPlayer != null) { manager.musicPlayer.MenuRequestsSong("NA_05 - Sparkles", 1.2f, 10f); } //Fix Label pixelperfect foreach (MenuObject o in this.pages[0].subObjects) { if (o is MenuLabel l) { l.pos += new Vector2(0.01f, 0.01f); } } }
public SteamMultiplayerMenu(ProcessManager manager, bool shouldCreateLobby = false) : base(manager, ProcessManager.ProcessID.MainMenu) { if (shouldCreateLobby) { MonklandSteamManager.instance.CreateLobby(); } #region UI ELEMENTS SIZE DEFINITION float resOffset = (1366 - manager.rainWorld.screenSize.x) / 2; // shift everything to the right depending on the resolution. 1/2 of the diff with the max resolution. float screenWidth = manager.rainWorld.screenSize.x; float screenHeight = manager.rainWorld.screenSize.y; // initialize some dynamic sizes and positions for UI elements. // player list and multiplayer settings have the same size no matter what the resolution. // the room chat adjusts to fill all the middle space float panelGutter = 15; // gap width between the panels float playerListWidth = 200; // constant float multiplayerSettingsWidth = 300; // constant float multiplayerSettingsSliderWidth = multiplayerSettingsWidth - 115; // constant float roomChatWidth = screenWidth - (playerListWidth + multiplayerSettingsWidth + panelGutter * 4); // depends on resolution float playerListPositionX = panelGutter; // position depending on size float multiplayerSettingsPositionX = screenWidth - (multiplayerSettingsWidth + panelGutter); // position depending on screen width float multiplayerSettingsSliderPositionX = multiplayerSettingsPositionX + 10; // constant float roomChatPositionX = playerListWidth + panelGutter * 2; // position depending on player list width float controlButtonSpaceHeight = 100; // constant float panelHeight = screenHeight - (controlButtonSpaceHeight + panelGutter * 2); // leaving a space for control buttons float panelPositionY = controlButtonSpaceHeight; // constant #endregion this.blackFade = 1f; this.lastBlackFade = 1f; this.pages.Add(new Page(this, null, "main", 0)); //this.scene = new InteractiveMenuScene( this, this.pages[0], MenuScene.SceneID.Landscape_SU ); //this.pages[0].subObjects.Add( this.scene ); this.darkSprite = new FSprite("pixel", true); this.darkSprite.color = new Color(0f, 0f, 0f); this.darkSprite.anchorX = 0f; this.darkSprite.anchorY = 0f; this.darkSprite.scaleX = screenWidth; this.darkSprite.scaleY = screenHeight; this.darkSprite.x = screenWidth / 2f; this.darkSprite.y = screenHeight / 2f; this.darkSprite.alpha = 0.85f; this.pages[0].Container.AddChild(this.darkSprite); this.blackFadeSprite = new FSprite("Futile_White", true); this.blackFadeSprite.scaleX = 87.5f; this.blackFadeSprite.scaleY = 50f; this.blackFadeSprite.x = screenWidth / 2f; this.blackFadeSprite.y = screenHeight / 2f; this.blackFadeSprite.color = new Color(0f, 0f, 0f); Futile.stage.AddChild(this.blackFadeSprite); //Multiplayer Settings Box colorBox = new RoundedRect(this, this.pages[0], new Vector2(resOffset + multiplayerSettingsPositionX, panelPositionY), new Vector2(multiplayerSettingsWidth, panelHeight), false); this.pages[0].subObjects.Add(colorBox); //Settings Label settingsLabel = new FLabel("font", "Multiplayer Settings"); settingsLabel.SetPosition(new Vector2(multiplayerSettingsPositionX + 70, screenHeight - 60)); Futile.stage.AddChild(this.settingsLabel); //Body Color Label bodyLabel = new FLabel("font", "Body Color"); bodyLabel.SetPosition(new Vector2(multiplayerSettingsPositionX + 70, screenHeight - 90)); Futile.stage.AddChild(this.bodyLabel); //Red Slider bodyRed = new HorizontalSlider(this, this.pages[0], "Red", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 130), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)patch_Slider.SliderID.BodyRed, false); bodyRed.floatValue = MonklandSteamManager.bodyColor.r; bodyRed.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyRed); //Green Slider bodyGreen = new HorizontalSlider(this, this.pages[0], "Green", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 170), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)patch_Slider.SliderID.BodyGreen, false); bodyGreen.floatValue = MonklandSteamManager.bodyColor.g; bodyGreen.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyGreen); //Blue Slider bodyBlue = new HorizontalSlider(this, this.pages[0], "Blue", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 210), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)patch_Slider.SliderID.BodyBlue, false); bodyBlue.floatValue = MonklandSteamManager.bodyColor.b; bodyBlue.buttonBehav.greyedOut = false; this.pages[0].subObjects.Add(this.bodyBlue); //Eye Color Label eyesLabel = new FLabel("font", "Eye Color"); eyesLabel.SetPosition(new Vector2(multiplayerSettingsPositionX + 70, screenHeight - 240)); Futile.stage.AddChild(this.eyesLabel); //Red Slider eyesRed = new HorizontalSlider(this, this.pages[0], "Red ", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 280), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)patch_Slider.SliderID.EyesRed, false); eyesRed.floatValue = MonklandSteamManager.eyeColor.r; this.pages[0].subObjects.Add(this.eyesRed); //Green Slider eyesGreen = new HorizontalSlider(this, this.pages[0], "Green ", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 320), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)patch_Slider.SliderID.EyesGreen, false); eyesGreen.floatValue = MonklandSteamManager.eyeColor.g; this.pages[0].subObjects.Add(this.eyesGreen); //Blue Slider eyesBlue = new HorizontalSlider(this, this.pages[0], "Blue ", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 360), new Vector2(multiplayerSettingsSliderWidth, 30), (Slider.SliderID)patch_Slider.SliderID.EyesBlue, false); eyesBlue.floatValue = MonklandSteamManager.eyeColor.b; this.pages[0].subObjects.Add(this.eyesBlue); //Slugcat Eyes Sprite eyes = new FSprite("FoodCircleB", true); eyes.scaleX = 1f; eyes.scaleY = 1.1f; eyes.color = new Color(0, 0, 0); eyes.x = multiplayerSettingsPositionX + 130; eyes.y = manager.rainWorld.screenSize.y - 236; eyes.isVisible = true; this.pages[0].Container.AddChild(this.eyes); //Slugcat Sprite slugcat = new FSprite("slugcatSleeping", true); slugcat.scaleX = 1f; slugcat.scaleY = 1f; slugcat.color = new Color(1f, 1f, 1f); slugcat.x = multiplayerSettingsPositionX + 136; slugcat.y = manager.rainWorld.screenSize.y - 235; slugcat.isVisible = true; this.pages[0].Container.AddChild(this.slugcat); //Debug Mode checkbox this.debugCheckBox = new CheckBox(this, this.pages[0], this, new Vector2(resOffset + multiplayerSettingsSliderPositionX + 120f, screenHeight - 400f), 120f, "Debug Mode", "DEBUG"); this.pages[0].subObjects.Add(this.debugCheckBox); //Slugcat Buttons this.slugcatButtons = new SelectOneButton[3]; this.slugcatButtons[0] = new SelectOneButton(this, this.pages[0], base.Translate("SURVIOR"), "Slugcat", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 445f), new Vector2(110f, 30f), this.slugcatButtons, 0); this.pages[0].subObjects.Add(this.slugcatButtons[0]); this.slugcatButtons[1] = new SelectOneButton(this, this.pages[0], base.Translate("MONK"), "Slugcat", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 490f), new Vector2(110f, 30f), this.slugcatButtons, 1); this.pages[0].subObjects.Add(this.slugcatButtons[1]); this.slugcatButtons[2] = new SelectOneButton(this, this.pages[0], base.Translate("HUNTER"), "Slugcat", new Vector2(resOffset + multiplayerSettingsSliderPositionX, screenHeight - 535f), new Vector2(110f, 30f), this.slugcatButtons, 2); this.pages[0].subObjects.Add(this.slugcatButtons[2]); //Back button this.backButton = new SimpleButton(this, this.pages[0], base.Translate("BACK"), "EXIT", new Vector2(resOffset + 15f, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.backButton); //Start Game button this.startGameButton = new SimpleButton(this, this.pages[0], "Start Game", "STARTGAME", new Vector2(resOffset + screenWidth - 125, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.startGameButton); //Ready Up button this.readyUpButton = new SimpleButton(this, this.pages[0], "Ready UP", "READYUP", new Vector2(resOffset + screenWidth - 250, 50f), new Vector2(110f, 30f)); this.pages[0].subObjects.Add(this.readyUpButton); //Multiplayer Chat this.gameChat = new MultiplayerChat(this, this.pages[0], new Vector2(resOffset + roomChatPositionX, panelPositionY), new Vector2(roomChatWidth, panelHeight)); this.pages[0].subObjects.Add(this.gameChat); //Invite menu playerList = new MultiplayerPlayerList(this, this.pages[0], new Vector2(resOffset + playerListPositionX, panelPositionY), new Vector2(playerListWidth, panelHeight), new Vector2(playerListWidth - 20, playerListWidth - 20)); this.pages[0].subObjects.Add(this.playerList); //Controller Combatability this.bodyRed.nextSelectable[1] = this.readyUpButton; this.bodyRed.nextSelectable[3] = this.bodyGreen; this.bodyGreen.nextSelectable[1] = this.bodyRed; this.bodyGreen.nextSelectable[3] = this.bodyBlue; this.bodyBlue.nextSelectable[1] = this.bodyGreen; this.bodyBlue.nextSelectable[3] = this.eyesRed; this.eyesRed.nextSelectable[1] = this.bodyBlue; this.eyesRed.nextSelectable[3] = this.eyesGreen; this.eyesGreen.nextSelectable[1] = this.eyesRed; this.eyesGreen.nextSelectable[3] = this.eyesBlue; this.eyesBlue.nextSelectable[1] = this.eyesGreen; this.eyesBlue.nextSelectable[3] = this.debugCheckBox; this.debugCheckBox.nextSelectable[1] = this.eyesBlue; this.debugCheckBox.nextSelectable[3] = this.readyUpButton; this.readyUpButton.nextSelectable[0] = this.backButton; this.readyUpButton.nextSelectable[1] = this.debugCheckBox; this.readyUpButton.nextSelectable[2] = this.startGameButton; this.readyUpButton.nextSelectable[3] = this.bodyRed; this.startGameButton.nextSelectable[0] = this.readyUpButton; this.startGameButton.nextSelectable[1] = this.eyesBlue; this.startGameButton.nextSelectable[2] = this.backButton; this.startGameButton.nextSelectable[3] = this.bodyRed; this.backButton.nextSelectable[0] = this.startGameButton; this.backButton.nextSelectable[2] = this.readyUpButton; this.backButton.nextSelectable[1] = this.bodyRed; this.backButton.nextSelectable[3] = this.eyesBlue; //Some Nice Music :) if (manager.musicPlayer != null) { manager.musicPlayer.MenuRequestsSong("NA_05 - Sparkles", 1.2f, 10f); } }
public void SpawnPlayer(string spawnName) { foreach (SpawnPoint s in spawnPoints) if (s.name.ToLower() == spawnName.ToLower()) { player.State = Player.PlayerState.IDLE; C.Save.lastDoor = spawnName; C.lastSave.copy(C.Save); if (s.showMapName) { FLabel mapNameLabel = new FLabel(C.largeFontName, map.mapName); C.getCameraInstance().AddChild(mapNameLabel); mapNameLabel.SetPosition(new Vector2(Futile.screen.width, Futile.screen.halfHeight * .8f)); Go.to(mapNameLabel, 1.5f, new TweenConfig().floatProp("x", 0).setEaseType(EaseType.BackOut).onComplete(() => { Go.to(mapNameLabel, .7f, new TweenConfig().floatProp("x", -Futile.screen.halfWidth).setDelay(.6f).setEaseType(EaseType.BackIn).onComplete(() => { mapNameLabel.RemoveFromContainer(); })); })); } s.SpawnPlayer(player); return; } }
override public void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); string backButtonText = "Back"; string titleText = "About The Game"; if (Main.instance.gameFinished) { // Display end game messages titleText = "The Ship Went Nuclear!"; _scoreLabel = new FLabel("Emulogic", "You Saved " + Main.instance.crewSaved + " Crew Members"); _scoreLabel.color = Color.black; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _scoreLabel.scale = 0.25f; _scoreLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight / 2); AddChild(_scoreLabel); _againButton = new FButton("buttonWide"); _againButton.AddLabel("Emulogic", "Play Again", Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _againButton.label.scale = 0.25f; _againButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + 80); AddChild(_againButton); _againButton.SignalRelease += HandleAgainButtonRelease; backButtonText = "Home"; } else { // diplay generic message } _textLabel = new FLabel("Emulogic", titleText); _textLabel.color = Color.black; _textLabel.scale = 0.5f; _textLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight * 2 / 3); AddChild(_textLabel); _quitButton = new FButton("buttonWide"); _quitButton.AddLabel("Emulogic", backButtonText, Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _quitButton.label.scale = 0.25f; _quitButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight); AddChild(_quitButton); _quitButton.SignalRelease += HandleQuitButtonRelease; string about = "Game Designed and created by Jason Rendel,\nfor Ludum Dare 27. My first game jam ever!\nCreated for the 48 hour competition.\n\n ---- Tools ----\n Unity 3d - Futile - Gimp \nTexture Packer - Glyph Designer - CFXR\n\nFollow me @jasonrendel\nCheck out what else I'm up to at www.jasonrendel.com"; _scoreLabel = new FLabel("Emulogic", about); _scoreLabel.color = Color.black; _scoreLabel.scale = 0.20f; _scoreLabel.SetPosition(Futile.screen.halfWidth, 200); AddChild(_scoreLabel); }
public void SpawnWords(string message, Vector2 pos, Color color) { FLabel test = new FLabel(C.smallFontName, message); foregroundLayer.AddChild(test); test.SetPosition(pos); test.color = color; test.alpha = 0; Go.to(test, .5f, new TweenConfig().floatProp("y", 15, true).floatProp("alpha", 1.0f).setEaseType(EaseType.QuadOut).onComplete(() => { Go.to(test, .5f, new TweenConfig().floatProp("y", 10, true)); Go.to(test, .5f, new TweenConfig().floatProp("alpha", 0).setDelay(.1f).setEaseType(EaseType.QuadOut).onComplete(() => { test.RemoveFromContainer(); })); })); }
public override void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; Main.instance.crewSaved = 0; FSprite background = new FSprite("mainGameViewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _levelManager = new LevelManager(); AddChild(_levelManager); this.shouldSortByZ = true; meltdownBar = new FSprite("meltdown"); meltdownBar.SetPosition(Futile.screen.halfWidth, 672); AddChild(meltdownBar); _closeButton = new FButton("button"); _closeButton.AddLabel("Emulogic","Quit",Color.black); _closeButton.label.scale = 0.25f; _closeButton.sortZ = 1; _closeButton.SignalRelease += HandleCloseButtonRelease; _closeButton.x = Futile.screen.width - 125.0f; _closeButton.y = Futile.screen.height -75.0f; AddChild(_closeButton); Clock clock = new Clock(); clock.SetPosition( 75.0f, Futile.screen.height - 75.0f); AddChild(clock); crewSavedLabel = new FLabel("Emulogic", "Crew Members Saved: 0"); crewSavedLabel.SetPosition( Futile.screen.halfWidth, Futile.screen.height - 45.0f); crewSavedLabel.scale = 0.25f; AddChild(crewSavedLabel); selectedInventory = new FSprite("inventorySelected"); selectedInventory.isVisible = false; AddChild(selectedInventory); //spawnInventory(); spawnCrew(2); _lastCycle = Main.GameTime; }