Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by beardedbuddha

Hey guys,
still working on my first small 2D sidescroller (my rite of passage, and my first game).

I want to do a level select screen, much like the ones you remember from Super Mario World.
You know, the one where you saw islands from above and you'd walk Mario along a set path from each level to the next. In this regard I have a couple of questions as to how I should do this.

As I see it, I have a couple of options. I could..

a) Do it as a level itself. A special WM built level with its own tilesize, tileset and rules.
Problems with this: My main game uses gravity and a specific control-scheme.. How would I go about changing all these parameters for the level-select screen only?

b) Do it as a separate game, is in LevelSelectScreen = ig.Game.extend({
Problems with this: If I do it like this, I have a hard time figuring out how I would pass data around between the different games. I could store things in an object in ig.gameState = {} or something like that. Any thoughts on this?

As I see it, these two are my best options. Could you give me some advice on how to structure the relationship between the level select screen, loading the levels, keeping track of the levels, global data and so on?

Thanks in advance
- BeardedBuddha

1 decade ago by paulh

im far from an expert, not even a noob .. but:

ig.game.yourstat will allow you to access data from anywhere.

ig.system.setGame(LevelSelect); would allow you to use new settings for your level select:



ig.module( 
	'game.levelselect' 
)
.requires(
	'impact.game'
	
)
.defines(function(){

LevelSelect = ig.Game.extend({
	
	font: new ig.Font( 'media/04b03.font.png' ),
	map: new ig.Image( 'media/map.jpg' ),
       

 init: function() {
   
     this.clearColor = null;
    },
    
update: function(){
   
        
},

draw: function() {
		// Draw all entities and backgroundMaps
		
		this.parent();
		this.map.draw( 0, 0 );
	}
	
   
	
});
});

1 decade ago by beardedbuddha

Good points..

I think I might go for this solution. Using a combination of a new "game" for the level select screen, a nice object for my global data (not much anyway) and MikeL's Director Plugin should be able to do the trick..

Input is still appreciated though!
Page 1 of 1
« first « previous next › last »