当前位置: 首页>>代码示例>>C#>>正文


C# Label.visibleTemp方法代码示例

本文整理汇总了C#中Label.visibleTemp方法的典型用法代码示例。如果您正苦于以下问题:C# Label.visibleTemp方法的具体用法?C# Label.visibleTemp怎么用?C# Label.visibleTemp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Label的用法示例。


在下文中一共展示了Label.visibleTemp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Battle


//.........这里部分代码省略.........
            lbl_moveLeft.Position = new Vector2(50, 510);
            MainWindow.add(lbl_moveLeft);

            lbl_move = new Label("");
            lbl_move.Position = new Vector2(150, 510);
            MainWindow.add(lbl_move);

            lbl_enter = new Label("ENTER");
            lbl_enter.LabelFun = ColorTheme.LabelColorTheme.LabelFunction.CONTROL;
            lbl_enter.Position = new Vector2(520, 462);
            MainWindow.add(lbl_enter);

            lbl_enterAction = new Label("Select Unit");
            lbl_enterAction.Position = new Vector2(600, 462);
            MainWindow.add(lbl_enterAction);

            lbl_v = new Label("V");
            lbl_v.LabelFun = ColorTheme.LabelColorTheme.LabelFunction.CONTROL;
            lbl_v.Position = new Vector2(520, 438);
            MainWindow.add(lbl_v);

            lbl_vAction = new Label("View Character");
            lbl_vAction.Position = new Vector2(550, 438);
            MainWindow.add(lbl_vAction);

            lbl_esc = new Label("ESC");
            lbl_esc.LabelFun = ColorTheme.LabelColorTheme.LabelFunction.CONTROL;
            lbl_esc.Position = new Vector2(520, 486);
            lbl_esc.Visible = false;
            MainWindow.add(lbl_esc);

            lbl_escAction = new Label("Cancel Movement");
            lbl_escAction.Position = new Vector2(570, 486);
            lbl_escAction.Visible = false;
            MainWindow.add(lbl_escAction);

            lbl_e = new Label("E");
            lbl_e.LabelFun = ColorTheme.LabelColorTheme.LabelFunction.CONTROL;
            lbl_e.Position = new Vector2(520, 510);
            MainWindow.add(lbl_e);

            lbl_eAction = new Label("End Turn");
            lbl_eAction.Position = new Vector2(550, 510);
            MainWindow.add(lbl_eAction);

            lbl_turnCount = new Label("Turn: " + turnCount + " / 10");
            lbl_turnCount.LabelFun = ColorTheme.LabelColorTheme.LabelFunction.BOLD;
            lbl_turnCount.Position = new Vector2(520, 390);
            MainWindow.add(lbl_turnCount);

            lbl_dmg = new Label("");
            lbl_dmg.Color = Color.Red;
            lbl_dmg.Position = new Vector2(0, 0);
            lbl_dmg.Visible = false;
            MainWindow.add(lbl_dmg);

            lbl_actionTaken = new Label("");
            lbl_actionTaken.Color = Color.Black;
            lbl_actionTaken.Position = new Vector2(250, 30);
            lbl_actionTaken.Font = Content.Graphics.Instance.ActionFont;
            lbl_actionTaken.Visible = false;
            MainWindow.add(lbl_actionTaken);

            lbl_armyTurn = new Label("TO BATTLE, COMRADES!");
            lbl_armyTurn.Font = Content.Graphics.Instance.TurnFont;
            lbl_armyTurn.center(50);
            lbl_armyTurn.doneShowing = armyTurnDone;
            lbl_armyTurn.visibleTemp(2000);
            MainWindow.add(lbl_armyTurn);

            lbl_battleOutcome = new Label("VICTORY!");
            lbl_battleOutcome.Font = Content.Graphics.Instance.TurnFont;
            lbl_battleOutcome.center(50);
            lbl_battleOutcome.doneShowing = endOfBattle;
            lbl_battleOutcome.Visible = false;
            MainWindow.add(lbl_battleOutcome);

            deploy(m, true);
            deploy(e, false);

            cmap.update(map);

            freemode = true;
            actionMode = false;
            targetMode = false;
            spellMode = false;
            itemMode = false;

            changeCurp(null, new EventArgObject(new Point(5, 6)));
            scp = new Point(5, 6);
            endTurnP = new Point(5, 6);

            setAllNotMoved();

            ai = new AI();
            ai.set(map, tm, cmap);
            ai.done = ai_done;

            MainWindow.InputEnabled = false;
        }
开发者ID:nlacombe42,项目名称:forgottenschism,代码行数:101,代码来源:Battle.cs

示例2: battle

        public static Boolean battle(CharMap cmap, Tilemap tm, String org, Map map, Unit ally, Unit enemy, Label dmg, Label action, ref Boolean gameOver, ref Boolean defeat, GameTime gameTime)
        {
            Character c = cmap.get(map.CursorPosition.X, map.CursorPosition.Y);
            Character m;
            Point p;
            Point ne;

            if (c != null && c.Organization == org && c.stats.movement != 0)
            {
                if(c is Healer)
                    ne = nearest(cmap, map.CursorPosition, "ennemy");
                else
                    ne = nearest(cmap, map.CursorPosition, "main");

                if (isAdj(map.CursorPosition, ne))
                {
                    c.stats.movement = 0;
                    p = map.CursorPosition;
                }
                else
                {
                    //finds path to nearest ennemy
                    p = pathFind(cmap, tm, map.CursorPosition, nearest(cmap, map.CursorPosition, "main"), org);
                    if (c.stats.movement > 0)
                    {
                            cmap.move(map.CursorPosition.X, map.CursorPosition.Y, p.X, p.Y);
                            map.changeCursor(new Point(p.X, p.Y));
                    }
                    c.stats.movement--;
                }

                if (c.stats.movement == 0)
                {
                    Point tar = targetCharacter(c, p, cmap);

                    if (tar != new Point(-1, -1))
                    {
                        m = cmap.get(tar.X, tar.Y);
                        map.CurLs.Add(tar, Content.Graphics.Instance.Images.gui.cursorRed);

                        if (c is Fighter)
                            dmg.Text = ((Fighter)c).attack(m);
                        else if (c is Archer)
                            dmg.Text = ((Archer)c).attack(m);
                        else if (c is Scout)
                            dmg.Text = ((Scout)c).attack(m);
                        else if (c is Healer)
                        {
                            dmg.Text = ((Healer)c).heal(m).ToString();
                            action.Text = "Heal";
                        }
                        else if (c is Caster)
                        {
                            dmg.Text = ((Caster)c).attack(m, new Spell("DerpCast", 1, 5, 1, 5));
                            action.Text = "DerpCast";
                        }
                        else
                            dmg.Text = "Cant";

                        if (action.Text == "")
                            action.Text = "Attack";

                        dmg.Position = new Vector2(tar.X * 64 - map.getTlc.X * 64, tar.Y * 64 - map.getTlc.Y * 64 + 20);
                        dmg.visibleTemp(500);
                        action.visibleTemp(500);

                        if (dmg.Text != "miss" || dmg.Text != "Cant")
                        {
                            enemy.set(c.Position.X, c.Position.Y, c);
                            ally.set(m.Position.X, m.Position.Y, m);
                            if (m.stats.hp <= 0)
                            {
                                if (m.isMainChar())
                                    gameOver = true;

                                ally.delete(m.Position.X, m.Position.Y);
                                cmap.set(tar.X, tar.Y, null);
                                cmap.update(map);

                                if (ally.Characters.Count <= 0)
                                    defeat = true;
                            }
                        }
                    }
                }
                return false;
            }
            else
            {
                for (int e = cmap.NumY - 1; e >= 0; e--)
                    for (int i = cmap.NumX - 1; i >= 0; i--)
                        if (cmap.isChar(i, e) && cmap.get(i, e).stats.movement != 0 && cmap.get(i, e).Organization == org)
                        {
                            if (map.CursorPosition != new Point(i, e))
                            {
                                map.CurLs.Clear();
                                dmg.Visible = false;
                                action.Visible = false;
                                action.Text = "";
                                map.changeCursor(new Point(i, e));
//.........这里部分代码省略.........
开发者ID:nlacombe42,项目名称:forgottenschism,代码行数:101,代码来源:derpAI.cs


注:本文中的Label.visibleTemp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。