Fupixel.GetIndex C# (CSharp) Method

GetIndex() public method

public GetIndex ( int x, int y ) : int
x int
y int
return int
    public int GetIndex(int x, int y)
    {
        return y * width + x;
    }

Usage Example

Example #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);
     }
 }
All Usage Examples Of Fupixel::GetIndex