Skip to content
Snippets Groups Projects
Commit 3f62f300 authored by Eric Rosenbaum's avatar Eric Rosenbaum Committed by GitHub
Browse files

Merge pull request #33 from ericrosenbaum/master

add audio engine
parents 175b4d77 2dd8c55b
No related branches found
No related tags found
No related merge requests found
const bindAll = require('lodash.bindall'); const bindAll = require('lodash.bindall');
const React = require('react'); const React = require('react');
const Renderer = require('scratch-render'); const Renderer = require('scratch-render');
const AudioEngine = require('scratch-audio');
const VM = require('scratch-vm'); const VM = require('scratch-vm');
const StageComponent = require('../components/stage/stage.jsx'); const StageComponent = require('../components/stage/stage.jsx');
...@@ -20,6 +21,8 @@ class Stage extends React.Component { ...@@ -20,6 +21,8 @@ class Stage extends React.Component {
componentDidMount () { componentDidMount () {
this.renderer = new Renderer(this.canvas); this.renderer = new Renderer(this.canvas);
this.props.vm.attachRenderer(this.renderer); this.props.vm.attachRenderer(this.renderer);
this.audioEngine = new AudioEngine();
this.props.vm.attachAudioEngine(this.audioEngine);
this.attachMouseEvents(this.canvas); this.attachMouseEvents(this.canvas);
} }
componentWillUnmount () { componentWillUnmount () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment