1 decade ago by ansimuz
Hi,
I am trying to create a start screen with a repetitive scrolling background. What do you think its the best approach?
Right now i am extending the game class to create a start screen like this:
I am trying to create a start screen with a repetitive scrolling background. What do you think its the best approach?
Right now i am extending the game class to create a start screen like this:
StartScreen = ig.Game.extend({
// instructText: new ig.Font('media/04b03-small.font.png'),
background: new ig.Image('media/forest.png'),
init: function(){
ig.input.bind(ig.KEY.SPACE, 'start');
},
update: function(){
if(ig.input.pressed('start')){
ig.system.setGame(MyGame);
}
this.parent();
},
draw: function(){
this.parent();
this.background.draw(0,0);
}
});
