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


C# Maze类代码示例

本文整理汇总了C#中Maze的典型用法代码示例。如果您正苦于以下问题:C# Maze类的具体用法?C# Maze怎么用?C# Maze使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: MazePrototypeFactory

 public MazePrototypeFactory(Maze maze, Room room, Door door, Wall wall)
 {
     this.prototypeMaze = maze;
     this.prototypeRoom = room;
     this.prototypeDoor = door;
     this.prototypeWall = wall;
 }
开发者ID:TheoAndersen,项目名称:GoF.CreationalPatterns,代码行数:7,代码来源:MazePrototypeFactory.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     enragedGrowl = GetComponent<AudioSource>();
     maze = GameObject.Find("Maze").GetComponent<Maze>();
     player = GameObject.Find("Player");
     Orientate(col, row);
 }
开发者ID:eaho1,项目名称:Shut-Up-and-Escape-With-Me,代码行数:8,代码来源:Monster_Behavior.cs

示例3: Start

    // Use this for initialization
    void Start()
    {
        maze = new Maze (32, 32);
        maze.generate ();

        aTexture = maze.tiles;
    }
开发者ID:JoaoFranciscoNeto,项目名称:team_armadillo,代码行数:8,代码来源:MazeDebug.cs

示例4: Update

	// Update is called once per frame
	void Update () 
	{
		if(mGen == null)
			mGen = FindObjectOfType<MazeGenerator>();
		else if(m == null && mGen != null)
		{
			m = mGen.currentMaze();
			if(m != null)
			{
				Texture2D t = new Texture2D((int)m.Dimensions().x, (int)m.Dimensions().y, TextureFormat.ARGB4444, false);
				for(int x=0; x<t.width; x++)
				{
					for(int y=0; y<t.height; y++)
					{
						if(m.GetCell(x,y).isWall)
							t.SetPixel(x,y,Color.black);
						else
							t.SetPixel(x,y,Color.white);
					}
				}
				t.anisoLevel = 0;
				t.filterMode = FilterMode.Point;
				t.Apply();
				im.sprite = Sprite.Create(t, new Rect(0,0,t.width,t.height), Vector2.one/2);
			}
		}
	}
开发者ID:Blueteak,项目名称:MazeWar,代码行数:28,代码来源:MiniMap.cs

示例5: Start

    // Use this for initialization
    void Start()
    {
        m_TileList = new List<Transform> ();
        for (int x = 0; x < 8; x++) {
            for (int y = 0; y < 12; y++) {
                int flag = m_MapConfigArray [x, y];
                var tileTF = Instantiate (tile, new Vector3 (y * 0.3f, -x * 0.3f, 0), Quaternion.identity) as Transform;
                if (flag == 1) {
                    tileTF.GetComponent<SpriteRenderer> ().color = Color.red;
                }
                m_TileList.Add (tileTF);
            }
        }

        Maze maze = new Maze(m_MapConfigArray);
        Point start = new Point(1, 1);
        Point end = new Point(1, 10);

        //		Transform startTile = m_TileList [1 * 12 + 1];
        //		startTile.GetComponent<SpriteRenderer> ().color = Color.black;
        //
        //		Transform endTile = m_TileList [6 * 12 + 10];
        //		endTile.GetComponent<SpriteRenderer> ().color = Color.black;

        var parent = maze.FindPath(start, end, false);

        while (parent != null)
        {
            Debug.Log(parent.X + ", " + parent.Y);
            Transform targetTile = m_TileList [parent.X * 12 + parent.Y];
            targetTile.GetComponent<SpriteRenderer> ().color = Color.green;

            parent = parent.ParentPoint;
        }
    }
开发者ID:PlayApple,项目名称:2DTilemapStarterKit,代码行数:36,代码来源:Map.cs

示例6: Update

	void Update () 
	{
		if(mGen == null)
			mGen = FindObjectOfType<MazeGenerator>();
		else if(m == null)
		{
			m = mGen.currentMaze();
		}
		else if(pControl == null)
		{
			GameObject g = GameObject.FindGameObjectWithTag("MyPlayer");
			if(g != null)
				pControl = g.GetComponent<PlayerControl>();
		}
		else
		{
			pOffset = pixelOffset();
			cellDim = cellDimenstions();
			icon.rectTransform.sizeDelta = new Vector2(cellDimenstions().x, cellDimenstions().y);
			icon.transform.localEulerAngles = new Vector3(0,0,-pControl.transform.localEulerAngles.y + 90);
			Vector2 pPos = pControl.pos();
			float x = pixelOffset().x + (cellDimenstions().x*pPos.x) + (cellDimenstions().x/2);
			float y = pixelOffset().y + (cellDimenstions().y*pPos.y) + (cellDimenstions().x/2);
			Vector2 v = new Vector2(x,y);
			GetComponent<RectTransform>().anchoredPosition = v;
		}
	}
开发者ID:Blueteak,项目名称:MazeWar,代码行数:27,代码来源:PlayerIcon.cs

示例7: Update

	// Update is called once per frame
	void Update () 
	{
		if(m == null)
		{
			m = gen.currentMaze();
			RandomPlacement();
		}

		if(!setup && PlayerControl)
		{
			gameObject.tag = "MyPlayer";
			SpriteObj.SetActive(false);
			CamHolder.SetActive(true);
		}
		bool up = Input.GetKeyDown(KeyCode.UpArrow);
		bool down = Input.GetKeyDown(KeyCode.DownArrow);
		bool left = Input.GetKeyDown(KeyCode.LeftArrow);
		bool right = Input.GetKeyDown(KeyCode.RightArrow);
		if(!PlayerControl)
			return;
		if(up || down || left || right)
		{
			CmdDoMovement(up, down, left, right);
		}
		CheckSeen();

			
		if(Input.GetKeyDown(KeyCode.Space))
		{
			StopCoroutine("LineShow");
			StartCoroutine("LineShow");
			CmdShoot();
		}
	}
开发者ID:Blueteak,项目名称:MazeWar,代码行数:35,代码来源:SinglePlayerControl.cs

示例8: Start

	// Помещаем персонажа в центр лабиринта
	void Start() {
		var maze = GameObject.Find("Maze").GetComponent<Maze>();
		transform.position = new Vector2(maze.width / 2, maze.height / 2);
		dest = transform.position;

		mazeInstance = GameObject.Find("Maze").GetComponent<Maze>();
	}
开发者ID:ilyachase,项目名称:Limbo-Maze,代码行数:8,代码来源:Circle.cs

示例9: Neighbours

    public static List<Cell> Neighbours(Maze maze, Point point)
    {
        List<Cell> neighbours = new List<Cell>();

        if (point.y > 1)
        {
            neighbours.Add(maze.Grid[point.x, point.y-1]);
        }

        if (point.y < maze.height-2)
        {
            neighbours.Add(maze.Grid[point.x, point.y+1]);
        }

        if (point.x > 1)
        {
            neighbours.Add(maze.Grid[point.x-1, point.y]);
        }

        if (point.x < maze.width-2)
        {
            neighbours.Add(maze.Grid[point.x+1, point.y]);
        }

        return neighbours;
    }
开发者ID:Catchouli-old,项目名称:SuperShooterGuy3D,代码行数:26,代码来源:Maze.cs

示例10: afterFrame

	IEnumerator afterFrame()
	{
		yield return true;
		online = true;
		m = GameObject.FindObjectOfType<MazeGenerator>().currentMaze();
		wantPos = randomPos();
	}
开发者ID:Blueteak,项目名称:MazeWar,代码行数:7,代码来源:AIPlayer.cs

示例11: generateNewStage

    public void generateNewStage(GameObject floorTile,
		                         GameObject wallBlock,
	                             GameObject coin,
	                             GameObject player,
	                             GameObject targetSprite,
	                             GameObject door,
		                         int difficulty,
	                             int maxDifficulty)
    {
        // Grab prefabs from function call
        _floorTile = floorTile;
        _wallBlock = wallBlock;
        _coin = coin;
        _player = player;
        _targetSprite = Instantiate(targetSprite);
        _door = door;
        // Determine size and num coins for this stage
        determineParamsBasedOnDifficulty(difficulty, maxDifficulty);
        // Create our maze
        _maze = new Maze(_size, difficulty, maxDifficulty);
        _maze.generateMap();
        // Allocate our arrays
        _coins = new GameObject[_numCoins];
        _components = new GameObject[(int)_size.x,(int)_size.y];
        // Instantiate our prefabs
        placeComponentsFromMap();
    }
开发者ID:elsnehador,项目名称:Crust,代码行数:27,代码来源:Stage.cs

示例12: MazyPrototypeFactory

 public MazyPrototypeFactory(Maze maze, Wall wall, Room room, Door door)
 {
     _maze = maze;
     _wall = wall;
     _room = room;
     _door = door;
 }
开发者ID:trupak,项目名称:DesignPatternsViaC,代码行数:7,代码来源:MazyPrototypeFactory.cs

示例13: BeginGame

 private void BeginGame()
 {
     mazeInstance = Instantiate(mazePrefab) as Maze;
     //StartCoroutine(mazeInstance.Generate());
     mazeInstance.Generate();
     timeLimit = mazeInstance.difficulty *1.5f;
     timerText.color = new Color(0,1,213.0f/255.0f);
 }
开发者ID:Choices-We-Make,项目名称:Game,代码行数:8,代码来源:GameManager.cs

示例14: BotFactory

 public BotFactory(Maze maze, EngineSettings settings, WallGrid walls, BrainFactory brainFactory, EyeFactory eyeFactory)
 {
     _maze = maze;
     _settings = settings;
     _walls = walls;
     _brainFactory = brainFactory;
     _eyeFactory = eyeFactory;
 }
开发者ID:PeterGerrard,项目名称:Maze-Machine-Learning-Demo,代码行数:8,代码来源:BotFactory.cs

示例15: render

        public override void render(Maze pmaze)
        {
            base.render(pmaze);

            statX.Text = pmaze.Width.ToString();
            statY.Text = pmaze.Height.ToString();
            statRendered.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
        }
开发者ID:stwalkerster,项目名称:beebmaze,代码行数:8,代码来源:NullMazeRenderScreen.cs


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