Exemplo n.º 1
0
        public void CollectDot(Vector2 point, MazeElementDefId dotType)
        {
            if (!IsPointOfType(point, dotType))
                return;

            gameController.CollectDot(dotType);

            int index = (int)(point.x * Cols + point.y);
            Elements[index] = (int)MazeElementDefId.floor;

            DotCount += 1;

            if (OnDotCollected != null)
                OnDotCollected(point);

            if (dotType == MazeElementDefId.energizer && OnEnergizerCollected != null)
                OnEnergizerCollected();
        }
Exemplo n.º 2
0
        public bool IsPointOfType(Vector2 point, MazeElementDefId elementDefId)
        {
            int index = (int)(point.x * Cols + point.y);

            if (Elements[index] == (int)elementDefId)
                return true;

            return false;
        }
Exemplo n.º 3
0
 public void CollectDot(MazeElementDefId dotType)
 {
     Scores += gameData.defs.mazeElements[((int)dotType).ToString()].scores;
 }