Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ( window ) {
- window.mylib = window.myLib || {};
- function SoapBoxBackground(){
- this.init();
- }
- SoapBoxBackground.prototype = new myLib.ParallaxScrollingBackground();
- SoapBoxBackground.prototype.init = function() {
- var mountains = new lib.Mountains();
- mountains.y = 0;
- var grass = new lib.Grass();
- grass.y = 120;
- var road = new lib.Road();
- road.y = -57;
- this.road = road;
- var bails = new lib.Bails();
- bails.y = 0;
- this.addChild(mountains);
- this.addChild(road);
- this.addChild(bails);
- this.addChild(grass);
- var layers = [mountains, bails, grass, road];
- var ratios = [.02, .55,.75, 1];
- this.setSpeed(-35);
- this.setLayers(layers);
- this.setRatios(ratios);
- this.setViewWidth(800);
- this.startScrolling();
- }
- //test meathod
- SoapBoxBackground.prototype.getRoad = function() {
- return this.road;
- }
- namespace.SoapBoxBackground = SoapBoxBackground;
- })( window );
Add Comment
Please, Sign In to add comment