å¤å£ã表示ãã¦ãæ±ã¨æ±ã®éã«å£ãã©ã³ãã ã«é
ç½®
æ¬å½ã«ã©ã³ãã ã«é
ç½®ããã ããªã®ã§ãè¿·è·¯ã«ãªã£ã¦ã¾ãã(´・Ïï½¥`)
ãã¡ãã§ç´¹ä»ããã¦ãããããªã¢ã«ã´ãªãºã ã§å£ãä½ãå¿
è¦ãããã¾ã
せっき~のゲーム屋さん ドルアーガの塔 乱数の工夫の正体
大ãããéããããããããé
ç½®ããã®ã¯ãªãããããã«ããã§ããã
é常ã®2Dã ã¨dotã®ä¸çãªã®ã«ãUnityã®åº§æ¨ç³»ã¯æ¬æ¥ã¯å°æ°ç¹ã®ä¸çãªã®ã§ã
2Dã¢ã¼ãã¨ãã£ã¦ãããã®ã¸ãããããã«ãã(´・Ïï½¥`)
æ±ã8x8ã§ã1unitã8dotæå®ãã¦ããã®ã§ãä»ã®ãããã8ã®åæ°ã§ä½ãå¿
è¦ãããã¾ããã
å£ã¯æ¨ª18dotã«ãã¦ããã®ã§ãããã ã¨8ã®åæ°ãããªãã®ã§ã¾ããã§ãã
ä½ããªããå¿
è¦ãããã¾ãã
for(int y=1;y<=8;y++) for(int x=0;x<=17;x++) { if( Random.Range (0, 100)<50 ) continue; SpriteRenderer obj=new GameObject("Sprite").AddComponent<SpriteRenderer>(); obj.sortingLayerName = "Units"; obj.sprite = Instantiate(Hwall) as Sprite; obj.transform.position = new Vector3(x*3+1.5f,y*3,0f); } for(int y=1;y<=8;y++) for(int x=0;x<=17;x++) { if( Random.Range (0, 100)<50 ) continue; SpriteRenderer obj=new GameObject("Sprite").AddComponent<SpriteRenderer>(); obj.sortingLayerName = "Units"; obj.sprite = Instantiate(Vwall) as Sprite; obj.transform.position = new Vector3(x*3,y*3+1.5f,0f); }