public void setupMenu() { FContainer menuSelector = new FContainer(); menuSelector.x = Futile.screen.width * 0.3f; menuSelector.y = -Futile.screen.height * 0.2f; selector.color = tone1; selector.height = 48; selector.width = Futile.screen.width * 2; menuSelector.AddChild(selector); FButton toAdd; toAdd = addButton("Play"); menuSelector.AddChild(toAdd); toAdd = addButton("Options"); toAdd.y -= 48; menuSelector.AddChild(toAdd); toAdd = addButton("Exit"); toAdd.y -= 96; menuSelector.AddChild(toAdd); this.AddChild(menuSelector); menuElements[0].label.color = tone2; }
public VirtualControlInputDeviceManager() { device = new InputDevice("VirtualControlInputDevice", 2, 2); device.AddAnalogControl(InputControlType.LeftStickX, "Virtual Stick"); device.AddAnalogControl(InputControlType.LeftStickY, "Virtual Stick"); device.AddButtonControl(InputControlType.Action1, "Virtual Button 1"); device.AddButtonControl(InputControlType.Action2, "Virtual Button 2"); InputManager.AttachDevice(device); var virtualStick = new VirtualControlStick(InputControlType.LeftStickX, InputControlType.LeftStickY); Node.AddChild(virtualStick); virtualControls.Add(virtualStick); var buttonPosition1 = new Vector2(Futile.screen.halfWidth - 128, -Futile.screen.halfHeight + 64); var virtualButton1 = new VirtualControlButton(InputControlType.Action1, "VirtualInput/ButtonA", buttonPosition1); Node.AddChild(virtualButton1); virtualControls.Add(virtualButton1); var buttonPosition2 = new Vector2(Futile.screen.halfWidth - 64, -Futile.screen.halfHeight + 128); var virtualButton2 = new VirtualControlButton(InputControlType.Action2, "VirtualInput/ButtonB", buttonPosition2); Node.AddChild(virtualButton2); virtualControls.Add(virtualButton2); Futile.touchManager.AddMultiTouchTarget(this); }
public VillDeathCloud(Vill vill) : base(vill.entityArea) { this.vill = vill; this.x = vill.x; this.y = vill.y + 4; frames = new FAtlasElement[] { Futile.atlasManager.GetElementWithName("Arena/Vill_Death1"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death2"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death3"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death4") }; cloudHolder = new FContainer(); cloudSprite = new FSprite(frames[0]); cloudSprite.scaleX = RXRandom.Bool() ? -1f : 1f; cloudHolder.AddChild(cloudSprite); cloudSprite.shader = FShader.Additive; cloudSprite.alpha = RXRandom.Range(0.8f, 0.9f); cloudSprite.color = vill.player.player.color.color + new Color(0.1f, 0.1f, 0.1f, 0.0f); graveHolder = new FContainer(); graveSprite = new FSprite("Arena/VillGrave1_body"); graveHolder.AddChild(graveSprite); graveSpriteColor = new FSprite("Arena/VillGrave1_color"); graveHolder.AddChild(graveSpriteColor); graveSpriteColor.color = vill.player.player.color.color + new Color(0.5f, 0.5f, 0.5f); graveSprite.y = graveSpriteColor.y = 5; Update(); }
void CreateSwatches(float delay) { for (int s = 0; s < 10; s++) { PlayerColor color = PlayerColor.allColors[s]; SwatchBox swatchBox = new SwatchBox(color); if (swatchBox.player.color == slot.player.color) { swatchBox.isSelected = true; } swatchBoxes.Add(swatchBox); keyboardAndSwatchContainer.AddChild(swatchBox); swatchBox.SignalPress += HandleSwatchTap; swatchBox.scale = 0.0f; Go.to(swatchBox, 0.3f, new TweenConfig() .floatProp("scale", 1.0f) .setDelay(delay + 0.04f * (float)s) .setEaseType(EaseType.ExpoOut)); } RepositionSwatches(); }
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 MGame(MInGamePage page) { instance = this; this.page = page; this.container = page; _players.Add(new MPlayer(0, true,"YOU",MColor.Green)); _players.Add(new MPlayer(1, false,"RED",MColor.Red)); _players.Add(new MPlayer(2, false,"BLUE",MColor.Blue)); _ais.Add (new MPlayerAI(_players[1], _players)); _ais.Add (new MPlayerAI(_players[2], _players)); _human = _players[0]; _beasts = new MBeast[_players.Count * (_human.maxBeasts + 20)]; CreateTowers(); container.AddChild(_beastContainer = new FContainer()); container.AddChild(_beastContainerSpecial = new FContainer()); container.AddChild(effectLayer = new MEffectLayer()); container.AddChild(hudLayer = new FContainer()); CreateUI(); Futile.instance.SignalUpdate += HandleUpdate; Futile.touchManager.AddMultiTouchTarget(this); ShowNote("CLICK TO MOVE THE GREEN GUYS!\nDESTROY THE ENEMY CELLS!\nEVOLVE BY USING DNA!",10.0f); }
public void Init(Player player, Vector2 startPos) { this.player = player; world.beastHolder.AddChild(holder = new FContainer()); gameObject.transform.position = new Vector3(startPos.x * FPhysics.POINTS_TO_METERS,startPos.y * FPhysics.POINTS_TO_METERS,0); gameObject.transform.parent = world.root.transform; bodyLink = gameObject.AddComponent<FPNodeLink>(); bodyLink.Init(holder, false); bodySprite = new FSprite("Evil-Eye_"+player.team.numString+"_01"); holder.AddChild(bodySprite); eyeSprite = new FSprite("Eye_" + player.numString); eyeSprite.scale = 0.33f; holder.AddChild(eyeSprite); //holder.alpha = 0.25f; goldSprite = new FSprite("Evil-Eye_crown_01"); holder.AddChild(goldSprite); goldSprite.isVisible = false; //goldSprite.shader = FShader.Additive; InitPhysics(); holder.ListenForUpdate(HandleUpdate); holder.ListenForLateUpdate(HandleLateUpdate); holder.ListenForFixedUpdate(HandleFixedUpdate); //AddTentacle(new Vector2(-20.0f, -20.0f), -90.0f); //AddTentacle(new Vector2(0.0f, -30.0f), 0.0f); //AddTentacle(new Vector2(20.0f, -20.0f), 90.0f); }
public GamePage() { // create dungeon _dungeon = new Dungeon(20); // add the dungeon/game portion of the screen Dungeon_Container = new FContainer(); AddChild(Dungeon_Container); // add current room Dungeon_Container.AddChild(_dungeon.CurrentRoom); // create player int px = (int)_dungeon.CurrentRoom.playerSpawnBox.box.x; int py = (int)_dungeon.CurrentRoom.playerSpawnBox.box.y; player = new Player(px, py); Dungeon_Container.AddChild(player); // reposition dungeon container to make room for UI Dungeon_Container.y = DUNGEON_CONTAINER_OFFSET; // add the UI portion of the screen AddChild(UI_Manager.getGameUIContainer(this)); // *** debug to find collision boxes //showCollisionsWithMen(); this.scale = 1; }
public static FContainer getGameUIContainer(GamePage game) { if (GameUIContainer == null) { GameUIContainer = new FContainer(); // add background FSprite bg = new FSprite("UI_background.png"); bg.x = 0; bg.y = Futile.screen.halfHeight - (bg.height / 2); GameUIContainer.AddChildAtIndex(bg, 99); // add minimap GameUIContainer.AddChild(game._dungeon.minimap); // add gold count playerGold.text = "g: " + game.player.GoldCount; playerGold.x += -140; playerGold.y += Futile.screen.halfHeight - 20; GameUIContainer.AddChild(playerGold); // add sanity count playerSanity.text = game.player.HP.ToString(); playerSanity.x += 260; playerSanity.y += Futile.screen.halfHeight - 60; GameUIContainer.AddChild(playerSanity); return(GameUIContainer); } else { return(GameUIContainer); } }
override public void Start() { ListenForUpdate(HandleUpdate); st = new SimpleTimer(); st.Start(); gameNodes = new FContainer(); Futile.atlasManager.LoadImage("car"); WEHTiled hurr = new WEHTiled("track"); gameNodes.AddChild(hurr.DrawLayer(0)); FContainer coll = hurr.DrawLayer(1); gameNodes.AddChild(coll); c = new Car(Futile.atlasManager.GetElementWithName("car"), coll); c.x = Futile.screen.width; c.y = -Futile.screen.height; c.rotation = 90; gameNodes.AddChild(c); lapCollider = new FSprite(Futile.whiteElement); lapCollider.scaleY = 5; lapCollider.SetPosition(1220, -832); lapCollider.alpha = 0; gameNodes.AddChild(lapCollider); RXWatcher.Watch(gameNodes); RXWatcher.Watch(lapCollider); this.AddChild(gameNodes); SetupUI(); }
void ShowMessage(string title, string message, Color color) { FContainer callout = new FContainer(); callout.scale = 0.5f; DualLabel titleLabel = new DualLabel(TOFonts.MEDIUM_BOLD, title); callout.AddChild(titleLabel); titleLabel.mainLabel.color = color; titleLabel.scale = 4.0f; titleLabel.y = 20.0f; titleLabel.shadowLabel.y += 0.5f; DualLabel messageLabel = new DualLabel(TOFonts.MEDIUM_BOLD, message); callout.AddChild(messageLabel); messageLabel.mainLabel.color = color; messageLabel.scale = 2.0f; messageLabel.y = -16.0f; Arena.instance.frontContainer.AddChild(callout); titleLabel.alpha = 0; messageLabel.alpha = 0; Go.to(titleLabel, 0.5f, new TweenConfig().alpha(1.0f)); Go.to(messageLabel, 0.5f, new TweenConfig().alpha(1.0f)); Go.to(callout, 3.0f, new TweenConfig().y(10.0f).removeWhenComplete()); Go.to(callout, 0.8f, new TweenConfig().setDelay(2.2f).alpha(0.0f)); }
public GamePage() { // create dungeon _dungeon = new Dungeon(20); // add the dungeon/game portion of the screen Dungeon_Container = new FContainer(); AddChild (Dungeon_Container); // add current room Dungeon_Container.AddChild(_dungeon.CurrentRoom); // create player int px = (int)_dungeon.CurrentRoom.playerSpawnBox.box.x; int py = (int)_dungeon.CurrentRoom.playerSpawnBox.box.y; player = new Player(px, py); Dungeon_Container.AddChild(player); // reposition dungeon container to make room for UI Dungeon_Container.y = DUNGEON_CONTAINER_OFFSET; // add the UI portion of the screen AddChild (UI_Manager.getGameUIContainer(this)); // *** debug to find collision boxes //showCollisionsWithMen(); this.scale = 1; }
public LevelBar(int numDashes) { this.numDashes = numDashes; string borderElementName = "UI/Stats/LevelBar_" + numDashes; if (numDashes == 5) { dashWidth = 19; } else if (numDashes == 10) { dashWidth = 9; } else if (numDashes == 25) { dashWidth = 3; } AddChild (barContainer = new FContainer ()); barContainer.AddChild (background = new FSprite ("Box")); //black bg background.color = Color.black; background.SetAnchor (0.0f, 0.0f); barContainer.AddChild (borderSprite = new FSprite (borderElementName));//white border borderSprite.SetAnchor (0.0f, 0); borderSprite.SetPosition (0, 0); barContainer.AddChild (dashContainer = new FContainer ()); dashSpacing = 1; totalWidth = 100; dashHeight = 3; barOffset = new Vector2 (-51, 0); dashOffset = new Vector2 (1, 2); ApplyConfig (); }
virtual protected FNode createObjectLayer(XMLNode node) { // add objects to FContainers FContainer objectGroup = new FContainer(); foreach (XMLNode fObject in node.children) { if (fObject.tagName == "object") { if (fObject.attributes.ContainsKey("gid")) { // create FSprite (override that function for specific class changes) objectGroup.AddChild(this.createTileObject(fObject)); } else { FNode newObject = this.createObject(fObject); if (newObject != null) { objectGroup.AddChild(newObject); } } } } // remember name _layerNames.Add(node.attributes["name"]); // add to self return(objectGroup); }
public static FContainer getGameUIContainer(GamePage game) { if (GameUIContainer == null) { GameUIContainer = new FContainer(); // add background FSprite bg = new FSprite("UI_background.png"); bg.x = 0; bg.y = Futile.screen.halfHeight - (bg.height / 2); GameUIContainer.AddChildAtIndex(bg, 99); // add minimap GameUIContainer.AddChild(game._dungeon.minimap); // add gold count playerGold.text = "g: " + game.player.GoldCount; playerGold.x += -140; playerGold.y += Futile.screen.halfHeight - 20; GameUIContainer.AddChild(playerGold); // add sanity count playerSanity.text = game.player.HP.ToString(); playerSanity.x += 260; playerSanity.y += Futile.screen.halfHeight - 60; GameUIContainer.AddChild(playerSanity); return GameUIContainer; } else return GameUIContainer; }
public void Init(FContainer container, uint color, bool shouldUpdateColliders) { _container = container; _container.AddChild(_drawHolder = new FContainer()); _color = RXUtils.GetColorFromHex(color); this.shouldUpdateColliders = shouldUpdateColliders; Collider[] colliders = gameObject.GetComponents <Collider>(); int colliderCount = colliders.Length; for (int c = 0; c < colliderCount; c++) { Collider collider = colliders[c]; FNode newNode = null; if (collider is BoxCollider) { FSprite sprite = new FSprite("Debug/Square"); sprite.color = _color; newNode = sprite; } else if (collider is SphereCollider) { FSprite sprite = new FSprite("Debug/Circle"); sprite.color = _color; newNode = sprite; } if (newNode != null) { _drawHolder.AddChild(newNode); _nodes.Add(newNode); } } FPPolygonalCollider mesh2D = gameObject.GetComponent <FPPolygonalCollider>(); if (mesh2D != null) { FPDebugPolygonColliderView debugView = new FPDebugPolygonColliderView("Debug/Triangle", mesh2D); debugView.color = _color; _drawHolder.AddChild(debugView); _nodes.Add(debugView); } Update(); if (!shouldUpdateColliders) { UpdateColliders(); //always update the colliders the first time } }
public override void HandleAddedToContainer(FContainer container) { container.AddChild(clockBackground); container.AddChild(timeLabel); container.AddChild(labelShadow); base.HandleAddedToContainer(container); container.AddChild(label); }
public override void AddToContainer(SpriteGroup sGroup, FContainer newContainer) { foreach (FSprite fsprite in sGroup.sprites) { fsprite.RemoveFromContainer(); newContainer.AddChild(fsprite); } newContainer.AddChild(text); }
private void InitTileMap() { // setup overall container and place it in the middle of the screen boardContainer = new FContainer(); boardContainer.x = Futile.screen.halfWidth - tileMapWidth * tileSize / 2f; boardContainer.y = Futile.screen.halfHeight - tileMapHeight * tileSize / 2f; AddChild(boardContainer); // create the blank background tiles for (int i = 0; i < tileMapWidth; i++) { for (int j = 0; j < tileMapHeight; j++) { FSprite backgroundTile = new FSprite("WhiteBox"); backgroundTile.width = backgroundTile.height = tileSize; backgroundTile.color = new Color(0.2f, 0.2f, 0.2f); backgroundTile.x = (i + 0.5f) * tileSize; backgroundTile.y = (j + 0.5f) * tileSize; boardContainer.AddChild(backgroundTile); } } // create random tiles and fill the board with them tileMap = new LineTile[tileMapWidth][]; for (int i = 0; i < tileMapWidth; i++) { tileMap[i] = new LineTile[tileMapHeight]; for (int j = 0; j < tileMapHeight; j++) { LineTileType randomTileType = (LineTileType)Random.Range(0, (int)LineTileType.MAX); RotationType randomRotationType = (RotationType)Random.Range(0, (int)RotationType.MAX); LineTile newTile = new LineTile(randomTileType, randomRotationType); newTile.tileIndex.xIndex = i; newTile.tileIndex.yIndex = j; newTile.sprite.width = newTile.sprite.height = tileSize; tileMap[i][j] = newTile; newTile.x = (i + 0.5f) * tileSize; newTile.y = (j + 0.5f) * tileSize; boardContainer.AddChild(newTile); } } // create the tile outlines for (int i = 0; i < tileMapWidth; i++) { for (int j = 0; j < tileMapHeight; j++) { FSprite backgroundTile = new FSprite("lineTileOutline"); backgroundTile.width = backgroundTile.height = tileSize; backgroundTile.color = new Color(0.2f, 0.2f, 0.2f); backgroundTile.x = (i + 0.5f) * tileSize; backgroundTile.y = (j + 0.5f) * tileSize; boardContainer.AddChild(backgroundTile); } } }
public void Init(FContainer container, uint color, bool shouldUpdateColliders) { _container = container; _container.AddChild(_drawHolder = new FContainer()); _color = RXUtils.GetColorFromHex(color); this.shouldUpdateColliders = shouldUpdateColliders; Collider[] colliders = gameObject.GetComponents<Collider>(); int colliderCount = colliders.Length; for(int c = 0; c<colliderCount; c++) { Collider collider = colliders[c]; FNode newNode = null; if(collider is BoxCollider) { FSprite sprite = new FSprite("Debug/Square"); sprite.color = _color; newNode = sprite; } else if(collider is SphereCollider) { FSprite sprite = new FSprite("Debug/Circle"); sprite.color = _color; newNode = sprite; } if(newNode != null) { _drawHolder.AddChild(newNode); _nodes.Add(newNode); } } FPPolygonalCollider mesh2D = gameObject.GetComponent<FPPolygonalCollider>(); if(mesh2D != null) { FPDebugPolygonColliderView debugView = new FPDebugPolygonColliderView("Debug/Triangle", mesh2D); debugView.color = _color; _drawHolder.AddChild(debugView); _nodes.Add(debugView); } Update(); if(!shouldUpdateColliders) UpdateColliders(); //always update the colliders the first time }
public override void AddToContainer(SpriteGroup sGroup, FContainer newContainer) { foreach (FSprite fsprite in sGroup.sprites) { fsprite.RemoveFromContainer(); newContainer.AddChild(fsprite); } newContainer.AddChild(startLabel); newContainer.AddChild(endLabel); newContainer.AddChild(valueLabel); }
public override void AddToContainer(SpriteGroup sGroup, FContainer newContainer) { foreach (FSprite fsprite in sGroup.sprites) { fsprite.RemoveFromContainer(); newContainer.AddChild(fsprite); } newContainer.AddChild(holdLabel); newContainer.AddChild(timeLabel); newContainer.AddChild(typeLabel); newContainer.AddChild(dirLabel); }
public void AddElement(InterfaceObject element) { if (visible) { element.OnActivate(); } element._parent = this; _elements.Add(element); _container.AddChild(element.container); }
public override void AddToContainer(SpriteGroup sGroup, FContainer newContainer) { foreach (FSprite fsprite in sGroup.sprites) { fsprite.RemoveFromContainer(); } newContainer.AddChild(sGroup.sprites[0]); if (sGroup.sprites.Length > 2) newContainer.AddChild(sGroup.sprites[2]); if (myText != null) newContainer.AddChild(myText); newContainer.AddChild(sGroup.sprites[1]); }
// Token: 0x060018DC RID: 6364 RVA: 0x0013F0F4 File Offset: 0x0013D2F4 public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner) { if (newContatiner == null) { newContatiner = rCam.ReturnFContainer("Items"); } for (int i = 0; i < sLeaser.sprites.Length; i++) { sLeaser.sprites[i].RemoveFromContainer(); } newContatiner.AddChild(sLeaser.sprites[0]); newContatiner.AddChild(sLeaser.sprites[1]); }
void Start() { FutileParams fparams = new FutileParams(true, true, false, false); fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, ""); //iPhone 3G fparams.AddResolutionLevel(960.0f, 2.0f, 1.0f, ""); //iPhone 4S fparams.AddResolutionLevel(1280.0f, 2.0f, 1.0f, ""); //Nexus 7 fparams.origin = new Vector2(0.5f, 0.5f); fparams.backgroundColor = new Color32(0, 0, 0, 255); //fparams.shouldLerpToNearestResolutionLevel = true; Futile.instance.Init(fparams); Futile.atlasManager.LoadAtlas("Atlases/sprites"); Futile.atlasManager.LoadFont("munro", "munro", "Atlases/munro", 0, 0); depthLabel = new FLabel("munro", "Depth: " + PlayerState.DEPTH); depthLabel.anchorX = 0.0f; depthLabel.anchorY = 0.0f; depthLabel.x = -Futile.screen.halfWidth + 20.0f; depthLabel.y = -Futile.screen.halfHeight + 10.0f; scoreLabel = new FLabel("munro", "Score: " + PlayerState.SCORE); scoreLabel.anchorX = 0.0f; scoreLabel.anchorY = 0.0f; scoreLabel.x = Futile.screen.halfWidth - 90.0f; scoreLabel.y = -Futile.screen.halfHeight + 10.0f; deathLabel = new FLabel("munro", "Ouch! Press to try again!"); deathLabel.anchorX = 0.0f; deathLabel.anchorY = 0.0f; deathLabel.x = -100.0f; deathLabel.y = -50.0f; bgContainer = new FContainer(); for (float x = -Futile.screen.halfWidth; x < Futile.screen.halfWidth + 56.0f; x += 56.0f) { background = new FSprite("background"); background.x = x; bgContainer.AddChild(background); } FSprite title = new FSprite("title"); title.y = 200.0f; bgContainer.AddChild(title); playerInput = new PlayerInput(); this.initGame(); }
public void InitLevel2() { clearMe(); Human human1 = new Human("person", new Vector2(300, 820)); background.AddChild(human1); humans.Add(human1); Human human2 = new Human("person_boat", LevelActorPaths.GetLevel2_Humans()[0]); foreground.AddChild(human2); humans.Add(human2); List <List <Step> > allPaths = LevelActorPaths.GetLevel2_Enemies(); Enemy boat1 = new Enemy("boat2", allPaths[0]); midground.AddChild(boat1); enemies.Add(boat1); Enemy boat2 = new Enemy("boat2", allPaths[1]); background.AddChild(boat2); enemies.Add(boat2); Enemy boat3 = new Enemy("sub2", allPaths[2]); midground.AddChild(boat3); enemies.Add(boat3); }
public Vill(VillagerActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; attackCooldown = RXRandom.Float(); //random cooldown to start so they're not synced offsetY = 6f; int numArts = 8; artIndex = RXRandom.Range(0, numArts) + 1; body = new FContainer(); bodySprite = new FSprite("Arena/Vill" + artIndex + "_body"); body.AddChild(bodySprite); colorSprite = new FSprite("Arena/Vill" + artIndex + "_color"); colorSprite.color = player.player.color.color; body.AddChild(colorSprite); weapon = new FContainer(); body.AddChild(weapon); string weaponName = RXRandom.GetRandomString("RollingPin", "Torch", "Pitchfork", "", "", "", ""); //Rake, FryingPan if (weaponName != "" && artIndex != 8) { if (weaponName == "Torch") { var torch = new VillTorch(); weapon.AddChild(torch); } else { FSprite weaponSprite = new FSprite("Arena/" + weaponName + "_1"); weapon.AddChild(weaponSprite); } } shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 0.7f; shadowSprite.scaleY = 0.5f; hopper = new Hopper(this); hopper.config.jumpDist = RXRandom.Range(18f, 19f); hopper.config.jumpDuration = RXRandom.Range(0.2f, 0.24f); hopper.config.jumpHeight = RXRandom.Range(3f, 4f); }
public Vill(VillagerActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; attackCooldown = RXRandom.Float(); //random cooldown to start so they're not synced offsetY = 6f; int numArts = 8; artIndex = RXRandom.Range(0,numArts)+1; body = new FContainer(); bodySprite = new FSprite("Arena/Vill"+artIndex+"_body"); body.AddChild(bodySprite); colorSprite = new FSprite("Arena/Vill"+artIndex+"_color"); colorSprite.color = player.player.color.color; body.AddChild(colorSprite); weapon = new FContainer(); body.AddChild(weapon); string weaponName = RXRandom.GetRandomString("RollingPin","Torch","Pitchfork","","","",""); //Rake, FryingPan if(weaponName != "" && artIndex != 8) { if(weaponName == "Torch") { var torch = new VillTorch(); weapon.AddChild(torch); } else { FSprite weaponSprite = new FSprite("Arena/"+weaponName+"_1"); weapon.AddChild(weaponSprite); } } shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 0.7f; shadowSprite.scaleY = 0.5f; hopper = new Hopper(this); hopper.config.jumpDist = RXRandom.Range(18f,19f); hopper.config.jumpDuration = RXRandom.Range(0.2f,0.24f); hopper.config.jumpHeight = RXRandom.Range(3f,4f); }
public void CreateTapEffect(Box box, float borderThickness) { TrackerBorderBox borderBox = new TrackerBorderBox(box, box.width, box.height, -borderThickness); Vector2 boxPos = effectContainer.OtherToLocal(box, new Vector2()); borderBox.x = boxPos.x; borderBox.y = boxPos.y; borderBox.rotation = box.rotation; borderBox.alpha = 0.35f; borderBox.scale = 1.0f; borderBox.shader = FShader.Additive; borderBox.color = box.player.color.color + new Color(0.3f, 0.3f, 0.3f); //add grey to make it brighter effectContainer.AddChild(borderBox); float growSize = 10.0f; float growScaleX = (borderBox.width + growSize) / borderBox.width; float growScaleY = (borderBox.height + growSize) / borderBox.height; Go.to(borderBox, 0.2f, new TweenConfig() .setEaseType(EaseType.Linear) .floatProp("scaleX", growScaleX) .floatProp("scaleY", growScaleY) .floatProp("alpha", 0.0f) .removeWhenComplete()); }
public override void Update() { if (stomach_bubbles_.Count < StomachLevel.MAX_STOMACH_BUBBLES) { Debug.Log("less stomach bubbles than max amount"); float new_bubble_chance = Random.value; if (new_bubble_chance > .5f) { Debug.Log("Creating a new bubble"); StomachBubble new_bubble = new StomachBubble(); stomach_bubbles_.Add(new_bubble); float x_pos = Random.value; float y_pos = Random.value; new_bubble.SetPosition(x_pos * bubble_container_size_.width + bubble_container_size_.xMin, y_pos * bubble_container_size_.height + bubble_container_size_.yMin); bubbles_container_.AddChild(new_bubble); } } for (int b = stomach_bubbles_.Count - 1; b >= 0; b--) { StomachBubble bubble = stomach_bubbles_[b]; if (bubble.Finished) { bubbles_container_.RemoveChild(bubble); stomach_bubbles_.Remove(bubble); } } }
public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner) { if (newContatiner == null) { switch (uglyWorkAroundName) { case "Tr_TankWall": newContatiner = rCam.ReturnFContainer("Foreground"); break; case "Tr_TankShadow1": newContatiner = rCam.ReturnFContainer("ForegroundLights"); break; case "Tr_TankShadow": newContatiner = rCam.ReturnFContainer("Shortcuts"); break; default: newContatiner = rCam.ReturnFContainer("Shortcuts"); break; } } foreach (FSprite fsprite in sLeaser.sprites) { fsprite.RemoveFromContainer(); newContatiner.AddChild(fsprite); } }
public HumanDeathCloud(Human human) : base(human.entityArea) { this.human = human; this.x = human.x; this.y = human.y+4; frames = new FAtlasElement[] { Futile.atlasManager.GetElementWithName("Arena/Vill_Death1"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death2"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death3"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death4") }; cloudHolder = new FContainer(); cloudSprite = new FSprite(frames[0]); cloudSprite.scaleX = RXRandom.Bool() ? -1f : 1f; cloudHolder.AddChild(cloudSprite); cloudSprite.shader = FShader.Additive; cloudSprite.alpha = RXRandom.Range(0.8f,0.9f); cloudSprite.color = human.player.player.color.color + new Color(0.1f,0.1f,0.1f,0.0f); cloudSprite.scale = 2.0f; graveHolder = new FContainer(); graveSprite = new FSprite("Arena/Human_Grave_1"); graveHolder.AddChild(graveSprite); graveSprite.color = human.player.player.color.color + new Color(0.5f,0.5f,0.5f); graveSprite.y = 16; Update(); }
public Keeper() { instance = this; SKDataManager.LoadData(); CellManager.Recalculate(); AddChild(mainContainer = new FContainer()); SetupMegaBoxes(); mainContainer.AddChild(slotList = new SlotList(Config.LIST_WIDTH, Config.HEIGHT)); AddChild(effectContainer = new FContainer()); slotList.SignalPlayerChange += HandlePlayerChange; HandlePlayerChange(); Futile.screen.SignalResize += HandleSignalResize; Futile.instance.SignalLateUpdate += HandleLateUpdate; FSoundManager.PlaySound("UI/Start"); }
public void AddToContainer() { FContainer c = parent.offscreenContainer; c.AddChild(_back); c.AddChild(_front); if (_key != null) { c.AddChild(_key); } if (_keySprite != null) { c.AddChild(_keySprite); } c.AddChild(_rtIndicator); }
public Wolf(WolfActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; offsetY = 12f; body = new FContainer(); bodySprite = new FSprite(WolfAnimation.Idle.frames[0]); body.AddChild(bodySprite); bodySprite.color = player.player.color.color + new Color(0.5f,0.5f,0.5f,0.0f); bodySprite.y = offsetY; body.scaleX = player.isFacingLeft ? 1f : -1f; // colorSprite = new FSprite("Arena/Wolf_Idle1_color"); // colorSprite.color = player.player.color.color; // body.AddChild(colorSprite); // shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 1.9f; shadowSprite.scaleY = 1.0f; }
public PlayerRow(Player player) { this.player = player; AddChild(inner = new FContainer()); inner.AddChild(iconContainer = new FContainer()); if(player.device.Name == "TOKeyboardProfileA") { icon = new FSprite("UI/WASDIcon"); } else if(player.device.Name == "TOKeyboardProfileB") { icon = new FSprite("UI/ArrowsIcon"); } else { icon = new FSprite("UI/ControllerIcon"); } icon.color = player.color.color; iconContainer.AddChild(icon); iconContainer.scale = 0; Go.to(iconContainer, 0.4f, new TweenConfig().scaleXY(1.0f).backOut()); ListenForUpdate(Update); }
public void MoveToFront() { if (_container != null) { _container.AddChild(this); } }
// Use this for initialization void Start() { FutileParams fParms = new FutileParams(false, false, true, true); fParms.AddResolutionLevel(1024.0f, 1.0f, 1.0f, ""); fParms.origin = new Vector2(0.5f, 0.5f); Futile.instance.Init(fParms); Futile.atlasManager.LoadAtlas("Atlases/art"); Futile.atlasManager.LoadFont("Franchise", "FranchiseFontAtlas.png", "Atlases/FranchiseLarge"); FSprite background = new FSprite("background.png"); Futile.stage.AddChild(background); Futile.stage.AddChild(mBombaNode = new FContainer()); Futile.stage.AddChild(mPepperNode = new FContainer()); mPepperNode.AddChild(mPepper = new Pepper(new FireDelegate(fire))); mSeed = new Seed(18, mPepper.y + mPepper.height / 2 - 15); Futile.stage.AddChild(mSeed); mScoreLabel = new FLabel("Franchise", "Score :"); mScoreLabel.anchorX = 0; mScoreLabel.anchorY = 1; mScoreLabel.color = new Color(1.0f, 0.90f, 0.0f); mScoreLabel.x = -Futile.halfWidth; mScoreLabel.y = Futile.halfHeight; Futile.stage.AddChild(mScoreLabel); Futile.touchManager.AddSingleTouchTarget(this); FSoundManager.PlayMusic("music", 0.45f); }
public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner) { if (newContatiner == null) { switch (this.assetName) { case "Tr_PipesA": newContatiner = rCam.ReturnFContainer("Foreground"); break; case "Tr_PipesB": newContatiner = rCam.ReturnFContainer("ForegroundLights"); break; case "Tr_PipesC": newContatiner = rCam.ReturnFContainer("Shortcuts"); break; default: newContatiner = rCam.ReturnFContainer("Shortcuts"); break; } } foreach (FSprite fsprite in sLeaser.sprites) { fsprite.RemoveFromContainer(); newContatiner.AddChild(fsprite); } }
public TeamPanel(Team team) { this.team = team; team.SignalTeamChange += HandleSignalPlayerChange; fullWidth = GameConfig.WINNING_SCORE * WIDTH_PER_NIB; bg = new FSliceSprite("PointBarBG", fullWidth+6.0f, 30.0f, 0, 10, 0, 10); AddChild(bg); bg.color = team.color; goldBG = new FSliceSprite("PointBarBGGold", fullWidth+6.0f, 30.0f, 0, 10, 0, 10); AddChild(goldBG); goldBG.alpha = 0.66f; goldBG.isVisible = false; for(int p = 0; p<GameConfig.WINNING_SCORE; p++) { FContainer nib = new FContainer(); nib.x = -fullWidth*0.5f + 15.0f + p * WIDTH_PER_NIB; nib.y = 0; FSprite bgSprite = new FSprite("PointBarNibBG"); bgSprite.color = team.color; nib.AddChild(bgSprite); AddChild(nib); nibs.Add(nib); } ListenForUpdate(HandleUpdate); }
public Heart() : base() { body = new FContainer (); bodySprite = new FSprite ("Game/heart"); body.AddChild (bodySprite); /* this.Collider = new Circle (bodySprite.width / 2, xx, yy); this.quad = new Quad(this.Collider.Left, this.Collider.Bottom, this.Collider.Right, this.Collider.Top); entityContainer.quadTree.Insert(Collider, ref quad);*/ }
void SetupScroller() { FRepeatSprite rs = new FRepeatSprite("drumstick2", Futile.screen.width*2, Futile.screen.height*2); FContainer scrollContainer = new FContainer(); scrollContainer.AddChild(rs); this.AddChild(scrollContainer); Go.to( scrollContainer, 10f, new TweenConfig() .floatProp("rotation", 360) .setIterations( -1, LoopType.RestartFromBeginning )); }
public House(float x, float y, EntityArea entityArea) : base(entityArea) { this.x = x; this.y = y; main = new FContainer(); mainSprite = new FSprite("Arena/House_1"); mainSprite.y = -offsetY; main.AddChild(mainSprite); blockingRect = new TORect(x-40,y-24,80,42); }
public Hero() : base() { body = new FContainer (); Engine.Scene.AddChild(body); bodySprite = new FSprite ("Game/player"); body.AddChild (bodySprite); Add(new InputComponent(true, true)); Add(new GravityComponent()); this.Collider = new Circle(bodySprite.width/2, CenterX, CenterY); this.quad = new Quad(this.Collider.Left, this.Collider.Bottom, this.Collider.Right, this.Collider.Top); Engine.Scene.quadTree.Insert(Collider, ref quad); }
public FenceV(float x, float y, EntityArea entityArea) : base(entityArea) { this.x = x; this.y = y; main = new FContainer(); mainSprite = new FSprite("Arena/fenceV_1"); mainSprite.y = -offsetY; main.AddChild(mainSprite); blockingRect = new TORect(x-4,y-30,8,60); blockingRect.shouldBlockVills = false; }
public WolfAttackBeam(Wolf wolf, float angle) : base(wolf.entityArea) { this.wolf = wolf; this.angle = angle; main = new FContainer(); main.rotation = angle; sprite = new FSprite("Arena/Wolf_AttackBeam"); sprite.x = -4f; main.AddChild(sprite); sprite.shader = FShader.Additive; sprite.color = wolf.player.player.color.color; }
public override void Init() { GamePage._gameObjects.AddChild(Holder = new FContainer()); gameObject.transform.position = new Vector3(Position.x * FPhysics.POINTS_TO_METERS,Position.y * FPhysics.POINTS_TO_METERS,64); gameObject.transform.parent = GamePage.root.transform; bodyLink = gameObject.AddComponent<FPNodeLink>(); bodyLink.Init(Holder, true); Holder.AddChild(Sprite); AngularDrag=5f; Mass=1f; Bounciness=0.5f; FrictionDyn=0.3f; FrictionSta=0.2f; InitPhysics(); }
public VillDeathCloud(Vill vill) : base(vill.entityArea) { this.vill = vill; this.x = vill.x; this.y = vill.y+4; frames = new FAtlasElement[] { Futile.atlasManager.GetElementWithName("Arena/Vill_Death1"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death2"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death3"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death4") }; cloudHolder = new FContainer(); cloudSprite = new FSprite(frames[0]); cloudSprite.scaleX = RXRandom.Bool() ? -1f : 1f; cloudHolder.AddChild(cloudSprite); cloudSprite.shader = FShader.Additive; cloudSprite.alpha = RXRandom.Range(0.8f,0.9f); cloudSprite.color = vill.player.player.color.color + new Color(0.1f,0.1f,0.1f,0.0f); graveHolder = new FContainer(); graveSprite = new FSprite("Arena/VillGrave1_body"); graveHolder.AddChild(graveSprite); graveSpriteColor = new FSprite("Arena/VillGrave1_color"); graveHolder.AddChild(graveSpriteColor); graveSpriteColor.color = vill.player.player.color.color + new Color(0.5f,0.5f,0.5f); graveSprite.y = graveSpriteColor.y = 5; Update(); }
// Use this for initialization void Start() { // Set up Futile. FutileParams fParams = new FutileParams(true, true, false, false); fParams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, ""); Futile.instance.Init(fParams); // Load assets. FAnimationManager.Instance.LoadAtlas(MY_ATLAS_PATH); FContainer container = new FContainer(); FSprite sprite = new FSprite(FSPRITE_ID); sprite.SetPosition(-100,0); //setup the animation sprite aSprite = new FAnimSprite(FANIM_ID); aSprite.SetPosition(100, 0); Futile.stage.AddChild(container); container.AddChild(sprite); container.AddChild(aSprite); }
public VillAttackBeam(Vill vill, float angle) : base(vill.entityArea) { this.vill = vill; this.angle = angle; main = new FContainer(); main.rotation = angle; sprite = new FSprite("Arena/Wolf_AttackBeam"); sprite.scale = 0.5f; sprite.x = -2f; main.AddChild(sprite); sprite.shader = FShader.Additive; sprite.color = vill.player.player.color.color; }
public FContainer DrawLayer(int id) { FContainer cont = new FContainer(); for(int row = 0;row < _layers[id]._height; row++) { for(int column = 0;column < _layers[id]._width; column++) { int sid = _layers[id]._data[(row*_layers[id]._width)+column]; if(sid!=0){ FSprite s = new FSprite(_tileset[0]._elements[sid-1]); s.SetAnchor(0, 1); s.x = column*32; s.y = -row*32; cont.AddChild(s); } } } return cont; }
public override void Start() { //CoroutineRunner.StartFutileCoroutine(setScore("philz", BaseMain.Instance._score)); SetupScroller(); FSoundManager.PlayMusic("dino_menu"); scoreArea = new FContainer(); this.AddChild(scoreArea); _bestScoreLabel = new FLabel("BitOut", "best scores!\n\n"); scoreArea.AddChild(_bestScoreLabel); _bestScoreLabel.color = new Color(1.0f, 0.9f, 0.2f); _bestScoreLabel.anchorY = 1; _bestScoreLabel.y = Futile.screen.halfHeight/1.25f; _bestScoreLabel.shader = new FShader("Wavey", Shader.Find("Wavey"), 10); CoroutineRunner.StartFutileCoroutine(PausedText()); }
public override void Init() { GamePage._gameObjects.AddChild(Holder = new FContainer()); gameObject.transform.position = new Vector3(Position.x * FPhysics.POINTS_TO_METERS,Position.y * FPhysics.POINTS_TO_METERS,32); gameObject.transform.parent = GamePage.root.transform; bodyLink = gameObject.AddComponent<FPNodeLink>(); bodyLink.Init(Holder, false); Holder.AddChild(sprite); AngularDrag=5f; Mass=1f; Bounciness=0.5f; FrictionDyn=0.3f; FrictionSta=0.2f; InitPhysics(); pd = new FParticleDefinition("Futile_White"); pd.endScale = 0.2f; pd.startColor = new Color(0,250,0,1f); pd.endColor = new Color (0, 90,0,0.01f); }
override public void Start() { _background = new FSprite("JungleClearBG"); AddChild(_background); //this will scale the background up to fit the screen //but it won't let it shrink smaller than 100% _logoHolder = new FContainer(); AddChild (_logoHolder); _logo = new FSprite("MainLogo"); _logoHolder.AddChild(_logo); _startButton = new FButton("YellowButton_normal", "YellowButton_down", "YellowButton_over", "ClickSound"); _startButton.AddLabel("Franchise","START",new Color(0.45f,0.25f,0.0f,1.0f)); AddChild(_startButton); _startButton.SignalRelease += HandleStartButtonRelease; _logoHolder.scale = 0.0f; Go.to(_logoHolder, 0.5f, new TweenConfig(). setDelay(0.1f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); _startButton.scale = 0.0f; Go.to(_startButton, 0.5f, new TweenConfig(). setDelay(0.3f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); HandleResize(true); //force resize to position everything at the start }
public Human(WolfActivePlayer player, EntityArea entityArea, bool shouldStartWithTransform) : base(entityArea) { this.player = player; isTransformingFromWolf = shouldStartWithTransform; tranPercent = 0.0f; offsetY = 18f; body = new FContainer(); bodySprite = new FSprite(HumanAnimation.Idle.frames[0]); body.AddChild(bodySprite); bodySprite.color = player.player.color.color + new Color(0.7f,0.7f,0.7f,0.0f); bodySprite.y = offsetY; body.scaleX = player.isFacingLeft ? 1f : -1f; // colorSprite = new FSprite("Arena/Human_Idle1_color"); // colorSprite.color = player.player.color.color; // body.AddChild(colorSprite); shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 1.9f; shadowSprite.scaleY = 1.0f; attackableRect = new TORect(0,0,62,29); healthBar = new HumanHealthBar(this); healthBar.alpha = 0.0f; Go.to(healthBar, 1.0f, new TweenConfig().alpha(1.0f)); float healthPercent = ((float)player.health / (float)Config.HUMAN_MAX_HEALTH); healthBar.SetPercent(healthPercent); }
public void Init(Team team, Vector2 startPos) { this.team = team; world.orbHolder.AddChild(holder = new FContainer()); gameObject.transform.position = new Vector3(startPos.x * FPhysics.POINTS_TO_METERS,startPos.y * FPhysics.POINTS_TO_METERS,0); gameObject.transform.parent = world.root.transform; link = gameObject.AddComponent<FPNodeLink>(); link.Init(holder, true); frames = new FAtlasElement[11]; for (int f = 0; f<frames.Length; f++) { frames[f] = Futile.atlasManager.GetElementWithName("orb"+f.ToString("00")); } sprite = new FSprite(frames[0].name); holder.AddChild(sprite); sprite.color = team.color; sprite.scale = scale; InitPhysics(); holder.ListenForUpdate(HandleUpdate); holder.ListenForFixedUpdate(HandleFixedUpdate); FSoundManager.PlaySound("orbAppears"); pd = new FParticleDefinition("Particles/Flame"); pd.startColor = team.color.CloneWithNewAlpha(0.2f); pd.endColor = Color.clear; }