package com.jln.ld;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public abstract class Shared {
	
	public static  boolean DEBUG = false;
	public static int CPT_DECAL = 0;
	public static int CPT_DECALBIS = 0;
	public static int DECAL_X = 0;
	public static int DECAL_Y = 0;
	
	/*
	 * CONSTANTES DE DIRECTION
	 */
	public static final int DIR_DOWN = 0;
	public static final int DIR_LEFT = 1;
	public static final int DIR_RIGHT = 2;
	public static final int DIR_UP = 3;
	
	/*
	 * CONSTANTES DE JEU
	 */
	public static final int GAME_WIDTH = 640;
	public static final int GAME_HEIGHT = 360;
	public static final String GAME_TITLE = "LD39";
	
	/*
	 * OBJETS PARTAGES
	 */
	public static SpriteBatch GAME_BATCH;
	public static SpriteBatch MENU_BATCH;
	
	// FONTS
	public static BitmapFont FONT, FONT_SMALL;

	// POINTS
	public static final int POINTS_ASTEROID_MEDIUM = 25;
	public static final int POINTS_DESTROYER = 90;
	public static final int POINTS_SMALL_DESTROYER = 60;
	public static final int POINTS_SMALL_EXTRA_DESTROYER = 120;
	public static final int POINTS_MEGA_DESTROYER = 400;
	
	/* ***********************************************
	 * TEXTURES
	 */
	
	// HUD 
	public static final TextureRegion[][] HUD_HUNTER_BACK  = TextureRegion.split(new Texture("hud/hunter_back.png"),200,16);
	public static final TextureRegion[][] HUD_SUPPLY_BACK  = TextureRegion.split(new Texture("hud/supply_back.png"),232,16);
	public static final Texture HUD_HUNTER01  = new Texture("hud/hunter01.png");
	public static final Texture HUD_HUNTER01B  = new Texture("hud/hunter01b.png");
	public static final Texture HUD_HUNTER02  = new Texture("hud/hunter02.png");
	public static final Texture HUD_HUNTER02B  = new Texture("hud/hunter02b.png");
	public static final Texture  HUD_HUNTER_BAR1  = new Texture("hud/hunter_bar1.png");
	public static final Texture  HUD_HUNTER_BAR2  = new Texture("hud/hunter_bar2.png");;
	public static final Texture  HUD_HUNTER_BAR3  = new Texture("hud/hunter_bar3.png");
	public static final TextureRegion[][]  HUD_SUPPLY_BAR  = TextureRegion.split(new Texture("hud/supply_bar.png"),20,8);
	
	public static final Texture HUD_PAUSE = new Texture("hud/pause.png");
	public static final Texture HUD_GAMEOVER = new Texture("hud/gameover.png");
	
	// SPACE
	public static final Texture SPACE_BACKGROUND = new Texture("space/back.png");
	public static final TextureRegion[][] STARS_BACK = TextureRegion.split(new Texture("space/stars01.png"),16,16);
	public static final TextureRegion[][] STARS_FRONT = TextureRegion.split(new Texture("space/stars02.png"),16,16);
	public static final TextureRegion[][] PLANET = TextureRegion.split(new Texture("space/random.png"),96,96);

	
	// SPACESHIPS
	public static final TextureRegion[][] SHIP_HUNTER = TextureRegion.split(new Texture("ship/hunter.png"),48,48);
	public static final TextureRegion[][] SHIP_HUNTER2 = TextureRegion.split(new Texture("ship/hunter2.png"),48,48);
	public static final TextureRegion[][] SHIP_SUPPLY = TextureRegion.split(new Texture("ship/supply.png"),48,48);
	
	public static final TextureRegion[][] SHIP_DESTROYER = TextureRegion.split(new Texture("ship/destroyer1.png"),64,64);
	public static final TextureRegion[][] SHIP_SMALL_DESTROYER = TextureRegion.split(new Texture("ship/destroyer2.png"),48,48);
	public static final TextureRegion[][] SHIP_SMALL_EXTRA_DESTROYER = TextureRegion.split(new Texture("ship/destroyer3.png"),48,48);
	public static final TextureRegion[][] SHIP_MEGA_DESTROYER = TextureRegion.split(new Texture("ship/megadestroyer.png"),96,96);
	
	public static final TextureRegion[][] SHIP_SHIELD= TextureRegion.split(new Texture("ship/shield.png"),48,48);

	// SHOOTS
	public static final Texture SHOOT_ENERGY = new Texture("shoot/energyshoot.png");
	public static final Texture SHOOT_HUNTER = new Texture("shoot/huntershoot.png");
	public static final Texture SHOOT_HUNTER2 = new Texture("shoot/hunter2shoot.png");
	public static final Texture SHOOT_DESTROYER1 = new Texture("shoot/destroyershoot.png");
	
	// MAP ITEMS
	public static final TextureRegion[][] ASTEROIDS = TextureRegion.split(new Texture("asteroid/48.png"),48,48);
	public static final TextureRegion[][] ASTEROIDS2 = TextureRegion.split(new Texture("asteroid/48-2.png"),48,48);
	public static final TextureRegion[][] ASTEROIDS3 = TextureRegion.split(new Texture("asteroid/48-3.png"),48,48);
	public static final TextureRegion[][] ASTEROIDS4 = TextureRegion.split(new Texture("asteroid/48-4.png"),48,48);
	public static final TextureRegion[][] POWERUP = TextureRegion.split(new Texture("item/powerup.png"),16,16);

	// ANIMATIONS
	public static final TextureRegion[][] ANIM_HEAL = TextureRegion.split(new Texture("animation/heal.png"),16,16);
	public static final TextureRegion[][] ANIM_EXPLOSION = TextureRegion.split(new Texture("animation/explosion.png"),32,32);
	public static final TextureRegion[][] ANIM_DESTROYER_EXPLOSION = TextureRegion.split(new Texture("animation/explosion_destroyer.png"),32,32);
	public static final TextureRegion[][] ANIM_WARNING = TextureRegion.split(new Texture("animation/warning.png"),16,16);
	public static final TextureRegion[][] ANIM_INFORMATION = TextureRegion.split(new Texture("hud/textAnimation.png"),88,16);
	public static final TextureRegion[][] ANIM_SWITCH = TextureRegion.split(new Texture("animation/switch.png"),48,48);
	
	public static final TextureRegion[][] ANIM_DESTROYER_SHOOT = TextureRegion.split(new Texture("animation/destroyershoot_animation.png"),8,8);
	public static final TextureRegion[][] ANIM_DESTROYER_HUNTER01_MOVE = TextureRegion.split(new Texture("animation/hunter1_move.png"),8,8);
	public static final TextureRegion[][] ANIM_DESTROYER_HUNTER02_MOVE = TextureRegion.split(new Texture("animation/hunter2_move.png"),8,8);

	// TITLE
	public static final Texture TITLE_FRONT = new Texture("title/title_front.png");
	public static final Texture TITLE_NEWGAME = new Texture("title/newgame.png");
	public static final Texture TITLE_QUIT = new Texture("title/quit.png");
	public static final TextureRegion[][] TITLE_TITLE_ANIMATION = TextureRegion.split(new Texture("title/title.png"),192,96);
	
	
	// SOUNDS
	public static final Sound SOUND_SELEC = Gdx.audio.newSound(Gdx.files.internal("sound/selec.wav"));
	public static final Sound SOUND_CONFIRM = Gdx.audio.newSound(Gdx.files.internal("sound/confirm.wav"));
	public static final Sound SOUND_ERROR = Gdx.audio.newSound(Gdx.files.internal("sound/no.wav"));
	public static final Sound SOUND_PICKUP = Gdx.audio.newSound(Gdx.files.internal("sound/pickup.wav"));
	
	public static final Sound SOUND_LASER_1 = Gdx.audio.newSound(Gdx.files.internal("sound/laser1.wav"));
	public static final Sound SOUND_LASER_2 = Gdx.audio.newSound(Gdx.files.internal("sound/laser2.wav"));
	public static final Sound SOUND_LASER_3 = Gdx.audio.newSound(Gdx.files.internal("sound/laser3.wav"));
	public static final Sound SOUND_LASER_4 = Gdx.audio.newSound(Gdx.files.internal("sound/laser4.wav"));
	public static final Sound SOUND_HEAL = Gdx.audio.newSound(Gdx.files.internal("sound/heal.wav"));
	
	public static final Sound SOUND_HIT = Gdx.audio.newSound(Gdx.files.internal("sound/hit1.wav"));
	public static final Sound SOUND_EXPLOSE = Gdx.audio.newSound(Gdx.files.internal("sound/explosion1.wav"));
	public static final Sound SOUND_EXPLOSE_2 = Gdx.audio.newSound(Gdx.files.internal("sound/explosion2.wav"));
	
	public static final Sound SOUND_SWITCH = Gdx.audio.newSound(Gdx.files.internal("sound/switch.wav"));
	
	// MUSICS
	public static final Music MUSIC_01 = Gdx.audio.newMusic(Gdx.files.internal("music/main.mp3"));
}
