function Archer () {
    this.lvl = 0,
    this.sprite = null
    this.id = 0;
    this.isDraggingTop = false;
    this.alive = true;
}

if (typeof serveur_levelArchers != 'undefined')
    var LvlArchers = serveur_levelArchers;
else
    var LvlArchers = [1,2,3,2,3,1,2,3,1];

if (typeof serveur_archersATuer != 'undefined')
    var ArcherToKill = serveur_archersATuer;
else
    var ArcherToKill = [[-1,-1,1], [3,2,-1], [1,-1,-1]];

if (typeof serveur_amount != 'undefined') 
    var montant = serveur_amount;
else
    var montant = 5000;

var game_text_style = { font: "128px Wood_Stevens_Bold", fill: "#903000", boundsAlignH: "center", boundsAlignV: "middle" };

function GameData () {
    this.archers = new Array();
    this.columns = new Array();
    this.stateGame = stateGame.NOTHING;
    this.round = 1;
    this.timeStartState = 0;
    this.placedArcher = 0;
    this.userPlaying = false;
    this.life_barre = null;
    this.dragonLife = 20;
}

var gameData = new GameData();

function Column () {
    this.width = 50;
    this.height = 65;
    this.x = 0;
    this.y = 0;
    this.sprite = null;
    this.archer = null;
    this.destroyed = false;
    this.chosen = false;
}

function getColumn(pointer) {
    x = pointer.x;
    y = pointer.y;
    for (i=0; i< gameData.columns.length; i++) {
        if (gameData.columns[i].x -10 < x)
            if (gameData.columns[i].y -60 < y)
                if (gameData.columns[i].x + gameData.columns[i].width > x +10)
                    if (gameData.columns[i].y + gameData.columns[i].height > y)
                        return gameData.columns[i];
    }
    return null;
}

var music_menu;
var music_game_calm;
var MusicDestroyed = false;
var blackScreen;
var sound_epee;
var sound_arrow;
var sound_arrow_leg;
var sound_Clairon;
var sound_FireBall;
var sound_hmm;
var sound_hmm2;
var sound_Explosion;
var sound_cri;
var explosion;
var animExplosion;