I cannot show you all of the code due to the licence agreement with impactjs, but here are the main and entity files.

                
ig.module( 
    'game.main' 
)
.requires(
    'impact.game',
    'impact.font',
    'game.levels.level1',
    'game.entities.player',
    'game.entities.otherplayer',
    'game.entities.bullet',
    'game.entities.netbullet',
    'game.entities.enemy'
)

.defines(function(){

    MyGame = ig.Game.extend({
        //global variables
        font: new ig.Font( 'media/font.png' ),
        smallfont: new ig.Font( 'media/smallfont.png' ),
        stats:{kills:1, wave:1, lastwave:0, rocks:0, prevrocks:0, deaths:0, bullets:0, fired:0, hits:0, time:0},
        lives:3,
        levelTimer:new ig.Timer(),
        showStats:false,
        start: new ig.Image( 'media/start.png' ),
        gameover: new ig.Image('media/gameover.png'),
        livesSprite: new ig.Image('media/spaceshipred.png'),
        HUD: new ig.Image('media/stat-matte.png'),
        bullets: 100,
        

        
        
        init: function() {
            // Initialize bind keys etc.
            ig.input.bind(ig.KEY.MOUSE1, 'move');
            ig.input.bind(ig.KEY.SPACE, 'minorbull');
            this.loadLevel (LevelLevel1);
            ig.game.levelTimer.reset();    //starts the timer to see how long it takes to complete the level
        },
        
        gameOver: function(){
            //shows new screen and submits score when user runs out of lives
            ig.game.stats.time = Math.round(ig.game.levelTimer.delta());
            ig.game.levelTimer= new ig.Timer();
            ig.finalStats=ig.game.stats;
            ig.system.setGame(GameOverScreen);
        },
   
        
        update: function() {
            // Update all entities and backgroundMaps
            this.parent();
            
            // Add your own, additional update code here
            var player = this.getEntitiesByType( EntityPlayer )[0];
            if( player ) {
                this.screen.x = player.pos.x - ig.system.width/2;
                this.screen.y = player.pos.y - ig.system.height/2;
            }          
            if (ig.game.stats.wave > ig.game.stats.lastwave)
            {
                //each new wave the user gets 10 more bullets for each boulder
                ig.game.bullets = ig.game.bullets + (ig.game.stats.wave * 150);
                ig.game.stats.lastwave = ig.game.stats.wave;
                ig.game.stats.rocks = 15*ig.game.stats.wave;
                for (var i=0; i< ig.game.stats.rocks;i++){
                    var randomx = Math.floor(Math.random() * (896 - 64 + 1)) + 576;
                    var randomy = Math.floor(Math.random() * (704 - 64 + 1)) + 704;
                    ig.game.spawnEntity(EntityEnemy, randomx, randomy);                    
                    //make the player invincible for 3 seconds at the start of each wave
                    player.invincible = true;
                    player.makeInvincible;
                    player.invincibleTimer = new ig.Timer();
                }
            }
            //once all the boulders are destroyed move onto the next wave
            if(ig.game.stats.kills ==  ig.game.stats.rocks + ig.game.stats.prevrocks)
            {
                ig.game.stats.wave = ig.game.stats.wave + 1;
                ig.game.stats.prevrocks = ig.game.stats.rocks + ig.game.stats.prevrocks;
            }
        },
    
        
        draw: function() {
            // Draw all entities, backgrounds and HUD
            this.parent();
            ig.game.HUD.draw(0,0);
            ig.game.font.draw("Lives: ", 25,5); 
            for(var i=0; i < this.lives; i++){
                this.livesSprite.draw(((this.livesSprite.width + 2) * i)+140, +11);
            }
            ig.game.font.draw("Wave: "+ig.game.stats.wave, 470,5);  

            //bottom hud
            ig.game.HUD.draw(0,422);     
            ig.game.font.draw("Bullets remaining: "+ig.game.bullets,25,427);
        }
        
    });
    
    //instruction screen
    StartScreen=ig.Game.extend({
        background:new ig.Image('media/start.png'),
        init: function(){
            ig.input.bind(ig.KEY.MOUSE1, 'start');
        },
        update: function(){
            if(ig.input.pressed('start')){
                ig.system.setGame(MyGame)
            }
            this.parent();
        },
        draw: function(){
            this.parent();
            this.background.draw(0,0);
        }
    });
    
    //game over screen
    GameOverScreen = ig.Game.extend({
        background:new ig.Image('media/gameover.png'),
        font: new ig.Font( 'media/font.png' ),
        stats:{},
        score:0,
        name:"",
        
        init:function(){
            //restart level
            ig.input.bind(ig.KEY.MOUSE1, 'start');
            this.stats = ig.finalStats;
            //calculates score here - can't show you how ;)
            ##########################
            ##########SECRET##########
            ##########################
        },
        
        update: function(){
            //submits score here - can't show you how ;)
            ##########################
            ##########SECRET##########
            ##########################
        },

        draw: function(){
            //display stats
            this.parent(); 
            var x = ig.system.width/2;
            var y = ig.system.height/2-20;
            this.background.draw(0,0);
            this.font.draw("Seconds Survived: "+this.stats.time, x,y-50,ig.Font.ALIGN.CENTER);
            this.font.draw('Score: '+this.score,x,y-10,ig.Font.ALIGN.CENTER);
            this.font.draw('Wave Reached: '+this.stats.wave,x,y+30,ig.Font.ALIGN.CENTER);
            this.font.draw('Kills: '+this.stats.kills,x,y+70,ig.Font.ALIGN.CENTER);
            this.font.draw('Deaths: '+this.stats.deaths,x,y+110,ig.Font.ALIGN.CENTER);
        }
    });

   
    // Start the Game with 60fps, a resolution of 320x240, scaled up by a factor of 2
    ig.main( '#canvas', StartScreen, 60, 640, 480, 1 );

});