Erste version PacMan

This commit is contained in:
2026-04-23 10:40:13 +02:00
parent e501f49bf2
commit e42ab18652
78 changed files with 8388 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
using UnityEngine;
public class GridLevel : MonoBehaviour
{
public int stelle;
public int breite;
public int höhe;
public int[] würfelchenLyer1;
public int[] würfelchenLyer2;
public GameObject block;
public GameObject rblock;
public GameObject sblock;
public int y = 0;
void Start()
{
würfelchenLyer1 = new int[]
{
1,1,1,1,1,1,1,
1,3,3,3,3,3,1,
1,3,2,2,2,3,1,
1,3,2,0,2,3,1,
1,3,2,2,2,3,1,
1,3,3,0,3,3,1,
1,1,1,1,1,1,1
};
for (int i = 0; i < höhe; i++)
{
for (int k = 0; k < breite; k++)
{
if (würfelchenLyer1[k+(i * breite)] == 1)
{
GameObject testwürfel = Instantiate(block);
testwürfel.transform.position = new Vector3(k, i, 0);
}
if (würfelchenLyer1[k + (i * breite)] == 2)
{
GameObject testwürfel = Instantiate(sblock);
testwürfel.transform.position = new Vector3(k, i, 0);
}
if (würfelchenLyer1[k + (i * breite)] == 3)
{
GameObject testwürfel = Instantiate(rblock);
testwürfel.transform.position = new Vector3(k, i, 0);
}
}
}
}
// Update is called once per frame
void Update()
{
Debug.Log("wert von Würfelchen an der Stelle " + stelle + " ist" + würfelchenLyer1[stelle]);
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 34f1ed3a0f13cb5499b171a6598eec55