import { Scene } from 'phaser'
import { emitter } from '@/plugins'
import map from '@/assets/game/assets/map2.json'
import Atlas from '@/assets/game/assets/Atlas.png'
import Maria_Lopez from '@/assets/game/assets/player/Maria_Lopez.png'
import Latoya_Williams from '@/assets/game/assets/player/Latoya_Williams.png'
import Cactus from '@/assets/game/assets/player/Cactus.png'
import Cowboy from '@/assets/game/assets/player/Cowboy.png'
import Coffin from '@/assets/game/assets/player/Coffin.png'
import CoffinJSON from '@/assets/game/assets/coffin.json'
import Coyote from '@/assets/game/assets/player/Coyote.png'
import Rajiv_Patel from '@/assets/game/assets/player/Rajiv_Patel.png'
import Isabella_Rodriguez from '@/assets/game/assets/player/Isabella_Rodriguez.png'
import Tamara_Taylor from '@/assets/game/assets/player/Tamara_Taylor.png'
import Arthur_Burton from '@/assets/game/assets/player/Arthur_Burton.png'
import Abigail_Chen from '@/assets/game/assets/player/Abigail_Chen.png'
import Klaus_Mueller from '@/assets/game/assets/player/Klaus_Mueller.png'
import Wolfgang_Schulz from '@/assets/game/assets/player/Wolfgang_Schulz.png'
import Carlos_Gomez from '@/assets/game/assets/player/Carlos_Gomez.png'
import Giorgio_Rossi from '@/assets/game/assets/player/Giorgio_Rossi.png'
import Carmen_Ortiz from '@/assets/game/assets/player/Carmen_Ortiz.png'
import Ayesha_Khan from '@/assets/game/assets/player/Ayesha_Khan.png'
import Jennifer_Moore from '@/assets/game/assets/player/Jennifer_Moore.png'
import Jane_Moreno from '@/assets/game/assets/player/Jane_Moreno.png'
import Francisco_Lopez from '@/assets/game/assets/player/Francisco_Lopez.png'
import Ryan_Park from '@/assets/game/assets/player/Ryan_Park.png'
import atlas from '@/assets/game/assets/atlas.json'
import atlas2 from '@/assets/game/assets/atlas2.json'
import shadi from '@/assets/game/assets/shadi.png'
export default class BootScene extends Scene {
    constructor() {
        super({ key: 'BootScene' })
    }

    preload() {
        this.load.image('Atlas', Atlas)
        this.load.tilemapTiledJSON('map2', map)
        this.load.image('shadi', shadi)

        this.load.atlas('Maria_Lopez', Maria_Lopez, atlas)
        this.load.atlas('Latoya_Williams', Latoya_Williams, atlas)
        this.load.atlas('Cactus', Cactus, atlas)
        this.load.atlas('Cowboy', Cowboy, atlas)
        this.load.atlas('Coyote', Coyote, atlas2)
        this.load.atlas('Coffin', Coffin, CoffinJSON)
        this.load.atlas('Rajiv_Patel', Rajiv_Patel, atlas)
        this.load.atlas('Isabella_Rodriguez', Isabella_Rodriguez, atlas)
        this.load.atlas('Tamara_Taylor', Tamara_Taylor, atlas)
        this.load.atlas('Arthur_Burton', Arthur_Burton, atlas)
        this.load.atlas('Abigail_Chen', Abigail_Chen, atlas)
        this.load.atlas('Klaus_Mueller', Klaus_Mueller, atlas)
        this.load.atlas('Wolfgang_Schulz', Wolfgang_Schulz, atlas)
        this.load.atlas('Carlos_Gomez', Carlos_Gomez, atlas)
        this.load.atlas('Giorgio_Rossi', Giorgio_Rossi, atlas)
        this.load.atlas('Carmen_Ortiz', Carmen_Ortiz, atlas)
        this.load.atlas('Ayesha_Khan', Ayesha_Khan, atlas)
        this.load.atlas('Jennifer_Moore', Jennifer_Moore, atlas)
        this.load.atlas('Jane_Moreno', Jane_Moreno, atlas)
        this.load.atlas('Francisco_Lopez', Francisco_Lopez, atlas)
        this.load.atlas('Ryan_Park', Ryan_Park, atlas)

        this.load.on('complete', () => {
            emitter.emit('completeGame')
            // progressBar.destroy();
        })
    }

    create() {
        this.scene.start('PlayScene2')
    }
}
