Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

leslei

Retornar peças ao lugar originall

Recommended Posts

Tenho que desenvolver um jogo com uma mapa da França, quando a pessoa arrasta uma das regioes e solta sobre o mapa no local certo, a regiao é fixada. O que eu gostaria agora de fazer mas nao consigo é apos todas as regioes estarem fixadas, no local correto, aparecer uma mensagem, ou MC dizendo "VOCE VENCEU" por exemplo.

 

Segue o codigo

 

CODE
// Norde-Pas-De-Calais

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvesnt();

}

// * start dragging

nordepasdecalais.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

nordepasdecalais.onRelease = nordepasdecalais.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == npdc) {

this._x = npdc._x;

this._y = npdc._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != npdc) {

this._x = 682;

this._y = 79;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Picardie

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

picardie.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

picardie.onRelease = picardie.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == pi) {

this._x = pi._x;

this._y = pi._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != pi) {

this._x = 427;

this._y = 75;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Alsace

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

alsace.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

alsace.onRelease = alsace.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == alsa) {

this._x = alsa._x;

this._y = alsa._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != alsa) {

this._x = 467;

this._y = 139;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Lorraine

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

lorraine.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

lorraine.onRelease = lorraine.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == lor) {

this._x = lor._x;

this._y = lor._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != lor) {

this._x = 461;

this._y = 219;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Franche-Comte

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

franchecomte.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

franchecomte.onRelease = franchecomte.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == fc) {

this._x = fc._x;

this._y = fc._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != fc) {

this._x = 502;

this._y = 315;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Corse

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

corse.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

corse.onRelease = corse.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == cor) {

this._x = cor._x;

this._y = cor._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != cor) {

this._x = 511;

this._y = 416;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Basse-Normandie

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

bassenormandie.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

bassenormandie.onRelease = bassenormandie.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == bn) {

this._x = bn._x;

this._y = bn._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != bn) {

this._x = 521;

this._y = 36;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Bretagne

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

bretagne.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

bretagne.onRelease = bretagne.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == bre) {

this._x = bre._x;

this._y = bre._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != bre) {

this._x = 727;

this._y = 38;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Pays de la Loire

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

paysdelaloire.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

paysdelaloire.onRelease = paysdelaloire.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == pdll) {

this._x = pdll._x;

this._y = pdll._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != pdll) {

this._x = 645;

this._y = 389;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Poitou Charentes

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

poitoucharentes.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

poitoucharentes.onRelease = poitoucharentes.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == pc) {

this._x = pc._x;

this._y = pc._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != pc) {

this._x = 643;

this._y = 287;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Aquitaine

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

aquitaine.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

aquitaine.onRelease = aquitaine.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == aqui) {

this._x = aqui._x;

this._y = aqui._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != aqui) {

this._x = 440;

this._y = 439;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Midi-Pyrenees

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

midi.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

midi.onRelease = midi.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == mp) {

this._x = mp._x;

this._y = mp._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != mp) {

this._x = 651;

this._y = 169;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Limousin

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

limousin.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

limousin.onRelease = limousin.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == lim) {

this._x = lim._x;

this._y = lim._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != lim) {

this._x = 705;

this._y = 466;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Auvergne

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

auvergne.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

auvergne.onRelease = auvergne.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == auv) {

this._x = auv._x;

this._y = auv._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != auv) {

this._x = 726;

this._y = 241;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Languedoc-Roussillon

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

languedoc.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

languedoc.onRelease = languedoc.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == lr) {

this._x = lr._x;

this._y = lr._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != lr) {

this._x = 742;

this._y = 355;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Rhône-Alpes

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

rhone.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

rhone.onRelease = rhone.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == ra) {

this._x = ra._x;

this._y = ra._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != ra) {

this._x = 323;

this._y = 431;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Provence-Alpes-Côte-D'azur

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

provence.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

provence.onRelease = provence.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == pacda) {

this._x = pacda._x;

this._y = pacda._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != pacda) {

this._x = 547;

this._y = 349;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Centre

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

centre.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

centre.onRelease = centre.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == cen) {

this._x = cen._x;

this._y = cen._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != cen) {

this._x = 554;

this._y = 242;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Champagne Ardenne

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

champagne.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

champagne.onRelease = champagne.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == ca) {

this._x = ca._x;

this._y = ca._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != ca) {

this._x = 533;

this._y = 132;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Bourgogne

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

bourgogne.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

bourgogne.onRelease = bourgogne.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == bour) {

this._x = bour._x;

this._y = bour._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != bour) {

this._x = 411;

this._y = 264;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Ile-de-France

// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

iledefrance.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

iledefrance.onRelease = iledefrance.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == idf) {

this._x = idf._x;

this._y = idf._y;

som.play();

resposta.play();

} else if (eval(this._droptarget) != idf) {

this._x = 754;

this._y = 222;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

// Haute-Normandie// * function used for onMouseMove

function fnUpdate() {

updateAfterEvent();

}

// * start dragging

haute.onPress = function() {

// *

// * set variables containing position before moving

// * this is used to move object back if not placed on

// * one of the two areas

//

this.x = this.x;

this.y = this.y;

// * drag stuff

this.startDrag(true);

this.onMouseMove = fnUpdate;

};

// * stop dragging

haute.onRelease = haute.onReleaseOutside=function () {

this.stopDrag();

delete this.onMouseMove;

if (eval(this._droptarget) == hn) {

haute._x = hn._x;

haute._y = hn._y;

resposta.play();

} else if (eval(this._droptarget) != hn) {

haute._x = 596;

haute._y = 118;

erro.play();

errada.play();

}

};

////////////////////////////////////////////

 

 

 

 

Desde ja obrigado

Compartilhar este post


Link para o post
Compartilhar em outros sites

Leslei,

 

 

Porque você não coloca um contador quando acerta o local e chama uma função que controla o número de acertos com um if e quando chegar ao total envia para um frame com a mensagem de vitoria ou para outra cena.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.