package net.greencouchgames.ld27;

import tv.ouya.console.api.OuyaIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class Receiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent.getAction().equals(OuyaIntent.ACTION_MENUAPPEARING)) {
        	u_Trail.removeTrail();
    		u_Projectiles.removeProjectiles();
    		u_Enemy.removeEnemies();
    		
    		Main.gsmusic.stop();
    		Main.gsmusic.release();
    		Main.menumusic.stop();
    		Main.menumusic.release();
    		Main.tankmusic.stop();
    		Main.tankmusic.release();
    		
    		Main.hurt.release();
    		Main.thrown.release();
    		Main.dodge.release();
    		Main.gameover.release();
    		Main.select.release();
    		Main.tankdie.release();
    		Main.tankshoot.release();
    		Main.enemydie.release();
    		
    		Main.buf_bgmenu.unload();
    	    Main.buf_logo.unload();
    	    
    	    Main.buf_bgsp.unload();
    	    Main.buf_bgscore.unload();

    	    Main.buf_circle.unload();
    	    Main.buf_ex1.unload();
    	    Main.buf_ex2.unload();
    	    
    	    Main.buf_baked1.unload();
    	    Main.buf_baked2.unload();
    	    Main.buf_baked3.unload();
    	    Main.buf_tankshell.unload();
    	    
    	    Main.buf_player.unload();
    	    
    	    Main.buf_enemy.unload();
    	    Main.buf_enemydown.unload();
    	    Main.buf_tank.unload();
    	    Main.buf_tankcannon.unload();
    	    
    	    Main.buf_count1.unload();
    	    Main.buf_count2.unload();
    	    Main.buf_count3.unload();
    	    Main.buf_count4.unload();
    	    Main.buf_count5.unload();
    	    Main.buf_count6.unload();
    	    Main.buf_count7.unload();
    	    Main.buf_count8.unload();
    	    Main.buf_count9.unload();
    	    Main.buf_count10.unload();
    	    
    	    Main.buf_tutorial1.unload();
    	    Main.buf_tutorial2.unload();
    	    Main.buf_tutorial3.unload();
    	    Main.buf_tutorial4.unload();
    	    Main.buf_tutorial5.unload();
    	    Main.buf_tutorial6.unload();
    	    Main.buf_close.unload();
    	    
    	    Main.font1.unload();
    		Main.font2.unload();
    		Main.font3.unload();
        }
    }
}