rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
459 stars 50 forks source link

Loading plugins #55

Open karneaud opened 6 years ago

karneaud commented 6 years ago

I'm using web pack to compile my code and I'm import a file playground.Soundcloud.js into my project


PLAYGROUND.Soundcloud = function(app) {
  this.app = app
  this.app.audio = Player
}

PLAYGROUND.Soundcloud.plugin = true

PLAYGROUND.Soundcloud.prototype = {

}

PLAYGROUND.Application.prototype.playTrack = function(url) {
  this.app.audio.resolve(url,
        {
          callback(track) {
            this.app.audio.audio.play()
            //clubber.listen(this.app.audio)
          },
          play: true
        })
}

PLAYGROUND.Application.prototype.loadAudio = function(audio, opts) {
  opts = opts || {}
}

The file is included but I'm not seeing the plugin

how do you load and instantiate plugins?