Exemple #1
0
    public Room(RoomScale scale)
    {
        data = LevelData.getLevel (ApplicationData.getLastLevel());
        int width = data.getRoomWidth ();
        int height = data.getRoomHeight ();

        entities = new RoomEntity[height][];
        for (int i=0; i < height; i++) {
            entities[i] = new RoomEntity[width];
        }

        instance = this;
        HallBuilder hallBuilder = new HallBuilder ();

        this.hall = hallBuilder.build (data);
        this.scale = scale;
        HallMeshBuilder meshBuilder = new HallMeshBuilder ();
        meshBuilder.setHall (hall);
        meshBuilder.setScale (scale);
        meshBuilder.process ();
        RoomObjectGenerator generator = new RoomObjectGenerator (data);

        for (int i=0; i<width; i++) {
            for (int j=0; j<height; j++) {
                entities[j][i] = generator.instantiateRoomObject(i, j);
            }
        }

        Game.GetInstance ().player.wait (6);
        if (ApplicationData.getLastLevel () == 1) {
            SoundManager.instance.PlaySingle ("introduccion");
        } else {
            SoundManager.instance.PlaySingle ("entrada-laberinto");
        }
    }
    public Hall build(LevelData data)
    {
        hallWidth = data.getRoomWidth ();
        hallHeight = data.getRoomHeight ();
        Hall hall = new Hall (hallWidth, hallHeight);

        for (int i=0; i<hallWidth; i++) {
            for (int j=0; j<hallHeight; j++) {
                hall.setHallNode(i, j, generateHallNode(data, i, j));
            }
        }
        return hall;
    }