Learn Create Your Own Split Screen

Next Page

Now let's make some changes to MySprite so it understands costumes.

function MySprite (img_url, width) { this.x = 0; this.y = 0; this.visible= true; this.costume = 0; this.costume_width = width; // etc } var kid = new MySprite("http://www.s2js.com/img/etc/boywalking.png", 115);