protected void init() {
        grid = new Object[HEIGHT][WIDTH];
        for (int i = 0; i < WIDTH; i++) {
            for (int j = 0; j < HEIGHT; j++) {
                grid[j][i] = null;
            }
        }
        // add the droid
        grid[(int) mDroid.getY()][(int) mDroid.getX()] = mDroid;

        // add 5 obstacles and 5 enemies at random positions
        for (int i = 0; i < 5; i++) {
            int x = random.nextInt(WIDTH);
            int y = random.nextInt(HEIGHT);
            while (grid[y][x] != null) {
                x = random.nextInt(WIDTH);
                y = random.nextInt(HEIGHT);
            }
            grid[y][x] = new Obstacle(x, y);
            obstacles.add((Obstacle) grid[y][x]);
            while (grid[y][x] != null) {
                x = random.nextInt(WIDTH);
                y = random.nextInt(HEIGHT);
            }
            grid[y][x] = new Enemy(x, y);
            enemies.add((Enemy) grid[y][x]);
        }
    }