Guest User

Untitled

a guest
Nov 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. (function ( window ) {
  2.  
  3. window.mylib = window.myLib || {};
  4.  
  5. function SoapBoxBackground(){
  6. this.init();
  7. }
  8.  
  9. SoapBoxBackground.prototype = new myLib.ParallaxScrollingBackground();
  10.  
  11. SoapBoxBackground.prototype.init = function() {
  12.  
  13. var mountains = new lib.Mountains();
  14. mountains.y = 0;
  15.  
  16. var grass = new lib.Grass();
  17. grass.y = 120;
  18.  
  19. var road = new lib.Road();
  20. road.y = -57;
  21.  
  22. this.road = road;
  23.  
  24. var bails = new lib.Bails();
  25. bails.y = 0;
  26.  
  27. this.addChild(mountains);
  28. this.addChild(road);
  29. this.addChild(bails);
  30. this.addChild(grass);
  31.  
  32. var layers = [mountains, bails, grass, road];
  33. var ratios = [.02, .55,.75, 1];
  34. this.setSpeed(-35);
  35. this.setLayers(layers);
  36. this.setRatios(ratios);
  37. this.setViewWidth(800);
  38. this.startScrolling();
  39. }
  40.  
  41. //test meathod
  42. SoapBoxBackground.prototype.getRoad = function() {
  43. return this.road;
  44. }
  45.  
  46. namespace.SoapBoxBackground = SoapBoxBackground;
  47. })( window );
Add Comment
Please, Sign In to add comment