示例#1
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this);
        }

        numOfEli = new int[5];

        //data structure of our game object
        map = new Element[areaSize, areaSize];

        //used to record element num in every column
        elementsCountInColumn = new int[9];

        //instantiate the seletors
        selector = (GameObject)Instantiate(selector, new Vector3(0f, 0f, 0f), Quaternion.identity);
        MoveSelector(new Vector3(-2, -2), false);

        for (int i = 0; i < elementsCountInColumn.Length; i++)
        {
            elementsCountInColumn[i] = 9;
        }

        LayoutElements();
    }
示例#2
0
 internal GraphicsHandler(IGameUI ui, Control gameArea)
 {
     this.ui     = ui;
     GameArea    = new GameArea(GraphicsConstants.GridAreaSize, gameArea, OnPaint);
     screenImage = new Bitmap(GraphicsConstants.GridAreaSize.Width, GraphicsConstants.GridAreaSize.Height);
     tileImage   = new Bitmap(GraphicsConstants.GridAreaSize.Width, GraphicsConstants.GridAreaSize.Height);
 }
示例#3
0
        public void SwitchOffDrawAliveCellsState()
        {
            GameArea gameArea = MainAreaFrame.Content as GameArea;

            gameArea.DrawedPoints.Clear();
            gameArea.DrawAliveCellsMode = false;
        }
 public LevelEditor()
 {
     InitializeComponent();
     tpi   = new Bitmap(TilePanel.Width, TilePanel.Height);
     bmp   = new Bitmap(TilePanel.Width, TilePanel.Height);
     area  = new Bitmap(GameArea.Width, GameArea.Height);
     br    = new SolidBrush(GameArea.BackColor);
     tv    = new sbyte[Map.MW + 8, Map.MH + 8];
     paths = new sbyte[Config.MPC, Config.MPL];
     for (int i = 0; i < Config.MPC; i++)
     {
         for (int j = 0; j < Config.MPL; j++)
         {
             paths[i, j] = -1;
         }
     }
     map              = new sbyte[Config.MLMAX];
     sf               = new StringFormat();
     sf.Alignment     = StringAlignment.Center;
     sf.LineAlignment = StringAlignment.Center;
     MD               = false;
     obj              = new Object();
     pea              = new PaintEventArgs(TilePanel.CreateGraphics(), TilePanel.ClientRectangle);
     gpea             = new PaintEventArgs(GameArea.CreateGraphics(), GameArea.ClientRectangle);
     hb               = new HatchBrush(HatchStyle.LargeConfetti, Color.DimGray, Color.Black);
     hb2              = new HatchBrush(HatchStyle.SmallConfetti, Color.DarkRed, Color.Black);
     ti               = 0; pap = 0; pc = 0;
     WaveFile         = String.Empty;
 }
示例#5
0
        /***** 読み込み・準備処理 **********************************************************/
        // コンストラクタ
        EnemyGenerator(GameController gc, GameArea ga, Player pl, House hs, BulletGenerator bg)
        {
            gameController  = gc;
            gameArea        = ga;
            player          = pl;
            house           = hs;
            bulletGenerator = bg;

            // ステージ指定してDataLibrarianからステージ構成情報→敵生成テーブル読み込み
            bool loadResult = LoadTable(DataLibrarian.Instance.GetStageInfo(gc.PlayingStage).GetPathEnemyGenerateTable());

            if (true == loadResult)
            {
                // 読み込み完了したらフラグを立てる
                _onLoadCompleteProperty.Value = true;
            }
            else
            {
                // TODO:読み込み失敗したらエラー通知してメインメニューに戻る?
                Debug.Log("EnemyGenerator load data failed...");
            }

            // Enemyに情報受け渡し
            EnemyBase.SetPlayer(player);
            EnemyBase.SetHouse(house);
            EnemyBase.SetGameArea(gameArea);
            EnemyBase.SetBulletGenerator(bulletGenerator);
            gameController.SpeedMagReactiveProperty.DistinctUntilChanged().Subscribe(mag => EnemyBase.UpdateSpeedMagnification(mag));
        }
示例#6
0
        public static void PlayerTurn(GameArea game)
        {
            switch (currentAction)
            {
            case "LEFT":
                game.bat.Move(-1, 0);
                break;

            case "RIGHT":
                game.bat.Move(1, 0);
                break;

            case "FIRE":
                game.FireBall();
                break;
            }

            currentAction = "";
            foreach (var brick in game.brickArray.Bricks)
            {
                Console.SetCursorPosition(brick.PositionX, brick.PositionY);

                Console.Write(brick.Colour.Substring(0, brick.SizeX));
            }
            Console.SetCursorPosition(game.bat.PositionX, game.bat.PositionY);
            Console.Write("Bat");


            {
                Console.SetCursorPosition(game.ball.PositionX, game.ball.PositionY);
                Console.Write("O");
            }

            System.Threading.Thread.Sleep(150);
        }
示例#7
0
    void Start()
    {
        ResourceGather resource = GetComponent <ResourceGather>();

        if (resource)
        {
            mTasks.Add(new ResourceGatherTask(gameObject));
        }

        GameItem item = GetComponent <GameItem>();

        if (item)
        {
            mTasks.Add(new PickUpItemTask(gameObject));
        }

        Bed bed = GetComponent <Bed>();

        if (bed)
        {
            mTasks.Add(new SleepTask(gameObject));
        }

        GameBuilding building = GetComponent <GameBuilding>();

        if (building)
        {
            mTasks.Add(new DeconstructTask(gameObject));
        }

        mGameArea = GetComponent <GameArea>();
        mTasks.Add(new MoveTask(transform.position));
        mMoveActionIndex = mTasks.Count - 1;
    }
示例#8
0
 // Called when the script is instantiated
 private void Awake()
 {
     // Get reference to the text mesh
     textMesh = GameObject.Find("Points")?.GetComponent <TextMesh>();
     // Create a game area helper
     gameArea = new GameArea();
 }
 void Start()
 {
     if (!gameArea)
     {
         gameArea = GameArea.Main;
     }
 }
示例#10
0
    public IEnumerator PreviewSceneCoroutine(GamePhase from, GamePhase to)
    {
        m_scenePreviewCamera.gameObject.SetActive(true);
        m_scenePreviewTarget.gameObject.SetActive(true);

        Transform cameraPivot = GameArea.GetGameArea(to).scenePreviewCameraPivot;

        m_scenePreviewCamera.transform.position = cameraPivot.position;

        m_scenePreviewTarget.Reset(GameArea.GetGameArea(from).scenePreviewTargetPosition);

        while (!m_scenePreviewTarget.triggered)
        {
            m_scenePreviewCamera.transform.rotation = cameraPivot.rotation * GameManager.camera.transform.rotation;
            yield return(null);

            if (Input.GetKeyDown(KeyCode.Return))
            {
                break;
            }
        }

        m_scenePreviewCamera.gameObject.SetActive(false);
        m_scenePreviewTarget.transform.SetParent(transform);
        m_scenePreviewTarget.gameObject.SetActive(false);
    }
示例#11
0
文件: Practice.cs 项目: aata/szotar
        void Layout()
        {
            // Choose a smaller font if it doesn't fit
            foreach (var label in new[] { phraseLabel, translationLabel })
            {
                if (label.Font == bigFont && label.Width > GameArea.Width)
                {
                    label.Font = smallFont;
                }
                else if (label.Font == smallFont)
                {
                    using (Graphics g = GameArea.CreateGraphics()) {
                        if (g.MeasureString(label.Text, bigFont).Width < GameArea.Width)
                        {
                            label.Font = bigFont;
                        }
                    }
                }
            }

            var height = phraseLabel.Height + translationLabel.Height;

            var px = (GameArea.Width - phraseLabel.Width) / 2;
            var tx = (GameArea.Width - translationLabel.Width) / 2;

            var py = (GameArea.Height - height) / 2;
            var ty = py + phraseLabel.Height;

            phraseLabel.Location      = new System.Drawing.Point(px, py);
            translationLabel.Location = new System.Drawing.Point(tx, ty);
        }
示例#12
0
    private void GenerateTile(Tile.Type type, Tile.Team color)
    {
        // Create and add tile
        GameObject tileGameObject = Instantiate(tilePrefab) as GameObject;
        GameObject baseObject     = color == Tile.Team.White ? whiteBase : blackBase;

        tileGameObject.transform.SetParent(baseObject.transform);
        Tile t = tileGameObject.GetComponent <Tile>();

        t.Setup(this, type, color);

        // Place the tile.
        // Bases are not on the normal map. They float. As such they only have q and y cords in their hex.
        List <Tile.Type> types = new List <Tile.Type>(TileCounts.Keys);
        int      q             = types.Count / 2 - types.IndexOf(t.type);
        int      i             = 0;
        Hex      hex;
        GameArea area = color == Tile.Team.Black ? GameArea.BlackBase : GameArea.WhiteBase;

        do
        {
            hex = new Hex(-q, 0, q, i, area);
            if (pieces.ContainsKey(hex))
            {
                i++;
            }
            else
            {
                pieces.Add(hex, t);
                t.Hex = hex;
                //Debug.Log("H - " + hex);
                return;
            }
        } while (true);
    }
示例#13
0
文件: Player.cs 项目: Cendrb/Arman
 public Player(Arman game, PositionInGrid positionInGrid, Texture2D texture, Block[,] gameArray, int oneBlockSize, int timeForMove, List<Entity> movableObjects, GameArea gameArea, Controls controls)
     : base(game, positionInGrid, texture, gameArray, oneBlockSize, timeForMove, movableObjects)
 {
     this.gameArea = gameArea;
     this.controls = controls;
     spawnPoint = positionInGrid;
 }
示例#14
0
 private void Awake()
 {
     if (gameArea == null)
     {
         gameArea = GameArea.Main;
     }
 }
        /// <summary>
        /// Return true if collision with wall
        /// </summary>
        /// <returns></returns>
        public bool IsHitWall(Snake snake, GameArea gameArea, Direction direction)
        {
            switch (direction)
            {
            case Direction.left:
                if (snake.HeadPosition.x == 0)
                {
                    return(true);
                }
                break;

            case Direction.down:
                if (snake.HeadPosition.y + 1 == gameArea.Height)
                {
                    return(true);
                }
                break;

            case Direction.up:
                if (snake.HeadPosition.y == 0)
                {
                    return(true);
                }
                break;

            case Direction.right:
                if (snake.HeadPosition.x + 1 == gameArea.Width)
                {
                    return(true);
                }
                break;
            }

            return(false);
        }
示例#16
0
    private void PrepareObjectsToTakeOrExamine(GameArea currentArea)
    {
        for (int i = 0; i < currentArea.interactableObjectsInArea.Length; i++)
        {
            string descriptionNotInInventory = interactableItems.GetObjectsNotInInventory(currentArea, i);

            if (descriptionNotInInventory != null)
            {
                areaInteractionDescription.Add(descriptionNotInInventory);
            }

            InteractableObjects interactableInArea = currentArea.interactableObjectsInArea[i];

            for (int j = 0; j < interactableInArea.interactions.Length; j++)
            {
                Interaction interaction = interactableInArea.interactions[j];
                if (interaction.inputAction.keyWord == "examine")
                {
                    interactableItems.examineDictionary.Add(interactableInArea.noun, interaction.textResponse);
                }

                if (interaction.inputAction.keyWord == "take")
                {
                    interactableItems.takeDictionary.Add(interactableInArea.noun, interaction.textResponse);
                }
            }
        }
    }
示例#17
0
    private void OnControllerColliderHit(ControllerColliderHit hit)
    {
        if (hit.gameObject.layer == LayerMask.NameToLayer("Ground"))
        {
            isOnGround = true;
        }

        GameArea gameArea = hit.gameObject.GetComponent <GameArea>();

        if (gameArea != null && !(FindObjectOfType <UICtrl>().isAlert))
        {
            StartCoroutine(gameArea.AlertGameAreaLimit());
        }

        if (hit.gameObject.layer == LayerMask.NameToLayer("Water"))
        {
            swim = true;
            anim.SetBool("swim", swim);
        }
        else if (swim)
        {
            swim = false;
            anim.SetBool("swim", swim);
        }
    }
        ///设置
        private void Setup()
        {
            //创建 GameArea
            mGameArea = new GameArea();

            mGameCamera = new GameCamera();

            mPickUpManager = new PickUpManager();

            mPlayer = new Player();

            mGameUi = new GameUI();

//            //创建 Canvas
////            var canvasGameobj=new GameObject("Canvas");
////            var canvas = canvasGameobj.AddComponent<Canvas>();
//            var canvasGameObj = new CanvasBuilder()
//                .RenderMode(RenderMode.ScreenSpaceOverlay)
//                .Build();
//
//            //默认值
////            canvas.renderMode = RenderMode.ScreenSpaceOverlay;
//
//            //创建Text
//            var scoreGameobj = new GameObject("Score");
//
//            //设置canvans父子节点
//            scoreGameobj.transform.SetParent(canvasGameObj.transform);
//            //需要手动设置一下位置
//            scoreGameobj.transform.localPosition = Vector3.zero;
//            var scoreText = scoreGameobj.AddComponent<Text>();
//            //需要手动设置字体
//            scoreText.font = Font.CreateDynamicFontFromOSFont("Arial", 16);
//            scoreText.text = "10";
        }
示例#19
0
 public BasicInfo(int iD, string nameEN, string nameDE, GameArea gameArea)
 {
     ID       = iD;
     NameEN   = nameEN;
     NameDE   = nameDE;
     GameArea = gameArea;
 }
示例#20
0
        public override int GetCreditWithPosition(Troop source, out Point?position)
        {
            //position = 0;
            position = new Point(0, 0);
            TroopList hostileTroopsInView = source.GetHostileTroopsInView();
            TroopList list2 = new TroopList();

            foreach (Troop troop in hostileTroopsInView)
            {
                if ((troop.IsInArchitecture || !troop.DaysToReachPosition(source.Position, 1)) || (troop.Army.Kind.Type == MilitaryType.水军))
                {
                    list2.Add(troop);
                }
            }
            foreach (Troop troop in list2)
            {
                hostileTroopsInView.Remove(troop);
            }
            if (hostileTroopsInView.Count == 0)
            {
                return(0);
            }
            List <Point> orientations = new List <Point>();
            int          num          = 0;

            foreach (Troop troop in hostileTroopsInView)
            {
                orientations.Add(troop.Position);
                num += troop.FightingForce;
            }
            int num2          = 0;
            int fightingForce = source.FightingForce;
            int num4          = source.TroopIntelligence + source.ChanceIncrementOfStratagem;

            if (num4 > 100)
            {
                num4 = 100;
            }
            num2 = (((GameObject.Square(num4) / 60) * num) / fightingForce) / 100;
            if (num2 > 0)
            {
                GameArea area = new GameArea();
                foreach (Point point in source.GetStratagemArea(source.Position).Area)
                {
                    if (!source.Scenario.PositionIsOnFire(point) && (source.Scenario.IsPositionEmpty(point) && source.Scenario.IsFireVaild(point, false, MilitaryType.步兵)))
                    {
                        area.Area.Add(point);
                    }
                }
                if (area.Count > 0)
                {
                    position = source.Scenario.GetClosestPosition(area, orientations);
                }
                else
                {
                    num2 = 0;
                }
            }
            return(num2);
        }
示例#21
0
        public void generate(int x, int y, int w, int h)
        {
            partitions = new List <GameArea>();
            GameArea root = new GameArea(x, y, w, h);

            partitions.Add(root);

            bool didsplit = true;

            while (didsplit)
            {
                didsplit = false;
                for (int i = partitions.Count - 1; i >= 0; i--)
                {
                    if (partitions[i].left == null && partitions[i].right == null)
                    {
                        if (partitions[i].width > maxroomsize || partitions[i].height > maxroomsize)
                        {
                            if (partitions[i].split())
                            {
                                partitions.Add(partitions[i].left);
                                partitions.Add(partitions[i].right);
                                didsplit = true;
                            }
                        }
                    }
                }
            }
        }
示例#22
0
        void Played_Click(object sender, RoutedEventArgs e)
        {
            if ((sender as Button)?.IsEnabled == false)
            {
                return;
            }

            (sender as Button).IsEnabled = false;

            int.TryParse((sender as Button)?.Name.Split('y')[0].Remove(0, 1), out var x);
            int.TryParse((sender as Button)?.Name.Split('y')[1], out var y);

            var type = Game.GetCamp(x, y);

            switch (type)
            {
            case CampType.Bomb:
                Game.End();
                TimerNumber.Content = Game.GameTime.Minutes + ":" + Game.GameTime.Seconds;
                GameArea.IsEnabled  = false;
                foreach (var coord in Game.BombXY)
                {
                    GameArea.FindChild <Button>($"x{coord.Split(',')[0]}y{coord.Split(',')[1]}").Content = new Image {
                        Source = new BitmapImage(new Uri($"Pics/bomb.png", UriKind.Relative)), Stretch = Stretch.Fill
                    }
                }
                ;
                break;

            case CampType.Blanck:
                //x -1 y
                if (x - 1 >= 0)
                {
                    GameArea.FindChild <Button>($"x{x - 1}y{y}").RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
                }
                //x + 1 y
                if (x + 1 < Game.Size)
                {
                    GameArea.FindChild <Button>($"x{x + 1}y{y}").RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
                }
                //x y + 1
                if (y + 1 < Game.Size)
                {
                    GameArea.FindChild <Button>($"x{x}y{y + 1}").RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
                }
                //x y - 1
                if (y - 1 >= 0)
                {
                    GameArea.FindChild <Button>($"x{x}y{y - 1}").RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
                }
                break;

            default:
                ((Button)sender).Content = new Image {
                    Source = new BitmapImage(new Uri($"Pics/number{type.GetHashCode()}.png", UriKind.Relative)), Stretch = Stretch.Fill
                };
                break;
            }
        }
示例#23
0
文件: Game.cs 项目: Awkk/BulletHell
        public Game(GameArea gameArea)
        {
            this.GameArea             = gameArea;
            gameArea.GameTime.Enabled = true;

            Player = new Player();
            AddGameObject(Player, new FollowCursor());
        }
 public void Init(EnemiesPool enemiesPool, GameArea gameArea)
 {
     currentWave      = WaveDesks[0];
     this.enemiesPool = enemiesPool;
     this.gameArea    = gameArea;
     SetupNextWave();
     gameArea.OnPlayerEntered.AddListener(TrySpawnEnemies);
 }
示例#25
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            GameArea game = new GameArea();

            Application.Run(game);
        }
示例#26
0
        public List <AreaChange> Clear()
        {
            var newArea = new GameArea(area.Fields.GetLength(0));
            var diffs   = GameAreaHelper.FindDiffs(area, newArea);

            area = newArea;
            return(diffs);
        }
示例#27
0
        private void OnTriggerEnter(Collider other)
        {
            GameArea area = other.GetComponent <GameArea>();

            if (area && gameAreaInhabited.IndexOf(area) < 0 && area.enabled)
            {
                gameAreaInhabited.Add(area);
            }
        }
    private void Awake()
    {
        gameArea       = FindObjectOfType <GameArea>();       // GetComponent
        gameController = FindObjectOfType <GameController>(); // GetComponent

        carcas_type = CarcasType.empty;
        carcas      = null;
        squaresList = new List <OneSquare>();
    }
示例#29
0
        public void SpawnNew(GameArea area, SnakeBody snake)
        {
            var availableFields = area.AllFields.Except(snake.GetBody().Select(n => (n.X, n.Y))).ToArray();

            var idx = _rnd.Next(0, availableFields.Length);

            X = availableFields[idx].X;
            Y = availableFields[idx].Y;
        }
示例#30
0
        /// <summary>
        /// Affiche la pause/le Game Over
        /// </summary>
        /// <param name="score">Score à afficher</param>
        /// <param name="gameArea">Dimentions de la zone de jeu</param>
        public static void Draw(int score, GameArea gameArea)
        {
            for (int i = 0; i < gameArea.Height; i++)
            {
                Console.SetCursorPosition(1, i + 1);
                for (int j = 0; j < gameArea.Width; j++)
                {
                    Console.Write(Game.emptyCase);
                }
            }

            if (Game.isGameOn)
            {
                Console.SetCursorPosition(gameArea.Width / 2 - 2, 1);
                Console.Write("PAUSE");
            }
            else
            {
                Console.SetCursorPosition(gameArea.Width / 2 - 5, 1);
                Console.Write("GAME OVER!");

                Console.SetCursorPosition(1, gameArea.Height);
                Console.Write("Developped by: the BananaSnake team");
            }

            if (Game.heightArea == 20 && Game.widthArea == 40)
            {
                Console.ForegroundColor = ConsoleColor.DarkGreen;
                Console.SetCursorPosition(2, 4);
                Console.WriteLine("                             (_)(_)   ");
                Console.SetCursorPosition(2, 5);
                Console.WriteLine("                            /     \\  ");
                Console.SetCursorPosition(2, 6);
                Console.WriteLine("                           /       |  ");
                Console.SetCursorPosition(2, 7);
                Console.WriteLine("                          /   \\  * | ");
                Console.SetCursorPosition(2, 8);
                Console.WriteLine("            ________     /    /\\__/  ");
                Console.SetCursorPosition(2, 9);
                Console.WriteLine("    _      /        \\   /    /       ");
                Console.SetCursorPosition(2, 10);
                Console.WriteLine("   / \\    /  ____    \\_/    /       ");
                Console.SetCursorPosition(2, 11);
                Console.WriteLine("  //\\ \\  /  /    \\         /       ");
                Console.SetCursorPosition(2, 12);
                Console.WriteLine("  V  \\ \\/  /      \\       /        ");
                Console.SetCursorPosition(2, 13);
                Console.WriteLine("      \\___/        \\_____/          ");
            }


            Console.SetCursorPosition(gameArea.Width / 2 - 4, gameArea.Height / 2 - 4);
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.Write("Score :");
            Console.SetCursorPosition(gameArea.Width / 2 - 2, gameArea.Height / 2 - 3);
            Console.Write(score);
        }
示例#31
0
 public GameArea(int xc, int yc, int w, int h)
 {
     this.x      = xc;
     this.y      = yc;
     this.height = h;
     this.width  = w;
     left        = null;
     right       = null;
 }
示例#32
0
 public static void DrawPacman(GameArea GA)
 {
     //coins
     GA.CreateBlock(BlockType.coin, new PositionInGrid(1, 1));
     GA.CreateBlock(BlockType.coin, new PositionInGrid(1, 3));
     GA.CreateBlock(BlockType.coin, new PositionInGrid(1, 5));
     //players
     GA.SpawnPlayer(new PositionInGrid(1), new Controls(Keys.Up, Keys.Right, Keys.Down, Keys.Left));
     GA.SpawnPlayer(new PositionInGrid(30, 20), new Controls(Keys.W, Keys.D, Keys.S, Keys.A));
     //mobs
     GA.SpawnMob(new PositionInGrid(8), 30, 10, 80);
     GA.SpawnMob(new PositionInGrid(9), 41, 100, 80);
     GA.SpawnMob(new PositionInGrid(10), 2, 2, 80);
     GA.SpawnMob(new PositionInGrid(20), 20, 45, 80);
 }
示例#33
0
    public void initLayout()
    {
        GameObject[] areas = GameObject.FindGameObjectsWithTag(CommonLogic.TAG_HOLDER_AREA);

        gameAreas = new GameArea[areas.Length];

        for (int i = 0; i < gameAreas.Length; i++)
        {
            gameAreas[i] = new GameArea(areas[i].transform);
        }
        /*
        foreach (GameObject item in areas)
        {
            item.initZones();
        }
        */
        // Init Scoreboard
        positScores = scorePositions.GetComponentsInChildren<Transform>();
    }
示例#34
0
 public static void DrawTest(GameArea GA)
 {
     GA.CreateBlock(BlockType.movable, new PositionInGrid(3, 5));
     GA.SpawnPlayer(new PositionInGrid(1), new Controls(Keys.Up, Keys.Right, Keys.Down, Keys.Left));
     GA.CreateBlock(BlockType.coin, new PositionInGrid(20));
 }
示例#35
0
        public static void DrawTata(GameArea GA)
        {
            GA.CreateBlock(BlockType.solid, new PositionInGrid(4, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(5, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(6, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(7, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(8, 2));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(16, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(24, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(25, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(26, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(27, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(28, 2));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(36, 2));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(6, 3));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(15, 3));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(17, 3));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(26, 3));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(35, 3));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(37, 3));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(6, 4));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(14, 4));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(18, 4));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(26, 4));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(34, 4));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(38, 4));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(6, 5));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(14, 5));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(18, 5));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(26, 5));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(34, 5));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(38, 5));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(6, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(14, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(15, 6));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(16, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(17, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(18, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(26, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(34, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(35, 6));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(36, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(37, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(38, 6));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(6, 7));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(14, 7));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(18, 7));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(26, 7));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(34, 7));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(38, 7));
            //puzzle/1 solid
            GA.CreateBlock(BlockType.solid, new PositionInGrid(0, 21));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(2, 24));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(3, 24));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(3, 21));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(4, 20));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(5, 20));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(5, 22));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(7, 21));
            //2 solid
            GA.CreateBlock(BlockType.solid, new PositionInGrid(18, 21));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(19, 20));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(19, 22));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(20, 19));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(21, 18));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(21, 24));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(22, 23));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(23, 20));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(23, 22));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(24, 21));
            //3 solid
            GA.CreateBlock(BlockType.solid, new PositionInGrid(37, 23));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(37, 24));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(38, 22));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(39, 21));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(39, 22));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(39, 24));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(40, 19));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(41, 20));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(41, 21));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(42, 18));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(44, 19));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(44, 20));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(44, 21));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(44, 22));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(44, 23));
            GA.CreateBlock(BlockType.solid, new PositionInGrid(44, 24));
            //1 movable
            GA.CreateBlock(BlockType.movable, new PositionInGrid(0, 20));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(0, 24));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(1, 22));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(2, 23));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(3, 22));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(4, 23));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(6, 20));
            //2 movable
            GA.CreateBlock(BlockType.movable, new PositionInGrid(20, 23));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(21, 20));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(21, 22));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(22, 19));
            //3 movable
            GA.CreateBlock(BlockType.movable, new PositionInGrid(40, 23));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(41, 24));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(42, 19));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(42, 23));
            GA.CreateBlock(BlockType.movable, new PositionInGrid(43, 22));

            //detectors
            GA.CreateBlock(BlockType.detector, new PositionInGrid(6, 10));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(16, 10));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(26, 10));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(36, 10));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(1, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(3, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(5, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(18, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(21, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(24, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(39, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(41, 17));
            GA.CreateBlock(BlockType.detector, new PositionInGrid(43, 17));
        }
示例#36
0
 void Start()
 {
     area = new GameArea(gameObject.name);
     smokeObject = GameObject.FindGameObjectWithTag("Smoke");
 }
示例#37
0
 void Start()
 {
     Area = new GameArea(gameObject.name);
 }