2011-02-12 14:55:38 +00:00
|
|
|
|
|
|
|
// -- Init the Background DIV
|
|
|
|
Layouts.Background = new Layout({
|
|
|
|
|
|
|
|
// -- Define elements to draw with options
|
|
|
|
el: [{
|
|
|
|
id: 'ground',
|
2011-12-19 20:46:06 +00:00
|
|
|
animate: function(obj) {
|
2011-02-12 14:55:38 +00:00
|
|
|
obj.y -= obj.parent.settings.speed*obj.parent.settings.direction;
|
|
|
|
obj.parent.settings.dom.css({backgroundPosition: '0 '+obj.y+'px'}) ;
|
2011-02-12 21:24:14 +00:00
|
|
|
obj.nodraw = true ;
|
2011-02-12 14:55:38 +00:00
|
|
|
}
|
|
|
|
}],
|
2011-12-19 20:46:06 +00:00
|
|
|
|
2011-02-12 14:55:38 +00:00
|
|
|
// -- Define current Speed
|
|
|
|
speed: 5,
|
|
|
|
direction: -1,
|
2011-02-12 21:24:14 +00:00
|
|
|
nomove: true,
|
2011-12-19 20:46:06 +00:00
|
|
|
|
2011-02-12 14:55:38 +00:00
|
|
|
// -- Define canvas parent
|
|
|
|
dom: $('div#background')
|
2011-12-19 20:46:06 +00:00
|
|
|
|
2011-02-12 14:55:38 +00:00
|
|
|
}) ;
|
|
|
|
|