diff --git a/README.md b/README.md index 1bd2045..edc54ab 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,13 @@ // You need to create a root container that will hold the scene you want to draw. var stage = new PIXI.Container(); +// Declare a global variable for our sprite so that the animate function can access it. +var bunny = null; + // load the texture we need PIXI.loader.add('bunny', 'bunny.png').load(function (loader, resources) { // This creates a texture from a 'bunny.png' image. - var bunny = new PIXI.Sprite(resources.bunny.texture); + bunny = new PIXI.Sprite(resources.bunny.texture); // Setup the position and scale of the bunny bunny.position.x = 400;