GetIndex() 공개 메소드

public GetIndex ( int x, int y ) : int
x int
y int
리턴 int
예제 #1
0
 private void CheckForGameOver()
 {
     if (snakeX < 1 || snakeX >= fupixel.width - 1 || snakeY < 1 || snakeY >= fupixel.height - 1 || fupixel.pixels[fupixel.GetIndex(snakeX, snakeY)] == snakeColor)
     {
         Application.LoadLevel(0);
     }
 }
예제 #2
0
 void Awake()
 {
     fupixel = gameObject.GetComponent <Fupixel>();
     fupixel.ClearPixels(Color.black);
     snakeParts = new Queue <int>();
     snakeX     = fupixel.width / 2;
     snakeY     = fupixel.height / 4;
     foodIndex  = fupixel.GetIndex(snakeX, fupixel.height / 2);
     snakeParts.Enqueue(fupixel.GetIndex(snakeX, snakeY));
     DrawWalls();
 }
예제 #3
0
파일: Snake.cs 프로젝트: JuhaKiili/Fupixel
 void Awake()
 {
     fupixel = gameObject.GetComponent<Fupixel>();
     fupixel.ClearPixels(Color.black);
     snakeParts = new Queue<int>();
     snakeX = fupixel.width / 2;
     snakeY = fupixel.height / 4;
     foodIndex = fupixel.GetIndex(snakeX, fupixel.height / 2);
     snakeParts.Enqueue(fupixel.GetIndex(snakeX, snakeY));
     DrawWalls();
 }